balajis / twitter-export

Tool for mass export of Twitter followers to Substack, Ghost, or email list.
MIT License
159 stars 9 forks source link

DM solution not compatible with Twitter ToS? #4

Open epicfaace opened 4 years ago

epicfaace commented 4 years ago

Twitter's automation rules say:

C. Automated Direct Messages Sending automated Direct Messages to users

You may not send unsolicited Direct Messages in a bulk or automated manner, and should be thoughtful about the frequency with which you contact users via Direct Message. You may send automated Direct Messages to users so long as: in advance of sending the Direct Message, the recipient(s) have requested or have clearly indicated an intent on Twitter to be contacted by you via Direct Message, for example by sending you a Direct Message; and you provide a clear and easy way for such users to opt-out of receiving automated Direct Messages, and promptly honor all such opt-out requests. The fact that a user is technically able to receive a Direct Message from you (e.g. because the user follows you, has enabled the ability to receive Direct Messages from any account, or because the user is in a pre-existing Direct Message conversation with you) does not necessarily mean they have requested or expect to receive automated Direct Messages from you.

It appears that merely implementing the DM solution (the "mass DM approach" outlined in the README) is not compatible with Twitter's ToS, unless followers that receive the DMs have explicitly given consent to send them DMs (such as sending you a DM, or clicking on a link, etc.).

Is my understanding correct? @balajis

NightMachinery commented 4 years ago

I think no legal solution sill be possible. The main resource Twitter has is the users. They won’t want to give that up.

DennisRutjes commented 4 years ago

mmm maybe there is a hiatus, you are sending 1 DM message to 1 user each, not multiple messages ;-), or you have to enter on each message, but that defeats the purpose I guess

mspanish commented 4 years ago

The Twitter TOS does make the bulk DM solution seem illegal, and any app that violates it will get its own dev key yanked pretty fast. I'll have my husband (lawyer) look over the TOS tomorrow and see if he sees any leeway here. Otherwise perhaps scraping from bios/websites is the only way to do it.

bconnorwhite commented 4 years ago

Using the official API:

Time to download all of Balaji's followers: 30 min Time to DM all of Balaji's followers: 220 days

Given that send DMs in this way is possibly against ToS, there's a good chance of getting banned before 220 days. Would be great if there was a solution for sending DMs outside of the official Twitter API.

Scraping bios/websites seems pretty unreliable, or at least must have a pretty low % with an email address?

mspanish commented 4 years ago

Getting followers ids does not give you enough information to sort them by priority - how about the time to download full record for each id?

transitive-bullshit commented 4 years ago

@mspanish if you have Twitter OAuth user credentials, you can convert ~90k user ids into full Twitter user objects every 15 minutes via the users/lookup endpoint. See my solution for a full example of this approach: https://github.com/saasify-sh/twitter-flock

mspanish commented 4 years ago

@transitive-bullshit ah cool I thought the rate was lower for that, thanks.

transitive-bullshit commented 4 years ago

You can do 900 calls to users/lookup every 15 min if you have OAuth user creds, and you can include up to 100 comma-separated user ids (or screen names) per call. 😄

It'll be ~30k every 15 minutes if you're not using user oauth credentials btw.

prayagverma commented 4 years ago

I think there is no easy way around this issue.

All that aside, I have also noticed a few positive things which are in favor of the Mass DM approach.

Lastly, I do think that one-off automated DM to every follower is the best available method for achieving our objective within the constraints imposed by Twitter. Reaching out to followers outside of Twitter (like email) by scrapping that information (aka their email address) from their profiles would require the explicit consent of every follower. But I do worry that for users with a large following, Twitter might not like the mass DM approach as it directly competes with their own offerings (aka Twitter Ads) and they have a sort of financial incentive in restricting such users from reaching out to their own followers free of cost

gg2001 commented 4 years ago

Time to download all of Balaji's followers: 30 min

@bconnorwhite How does it take only 30 mins?

It seems like the official twitter API only allows you to make 1 request a minute:

ryandotelliott commented 4 years ago

Time to download all of Balaji's followers: 30 min

@bconnorwhite How does it take only 30 mins?

It seems like the official twitter API only allows you to make 1 request a minute:

It states Requests / 15-min window (user auth) | 15 This means you can make 15 requests in 15 minutes, each request, however, can have a maximum of 200 users per. This means a total of 3000 users per 15 minutes.

transitive-bullshit commented 4 years ago

@gg2001 @DeveloperRyan if you first export the ids of all your followers and then use lookup/users, it's significantly faster than the approach you're talking about.

This has been tested & verified locally via https://github.com/saasify-sh/twitter-flock

ryandotelliott commented 4 years ago

@transitive-bullshit I appreciate the advice! I'll go ahead with implementing that method then.

balajis commented 4 years ago

@epicfaace There are many inconsistent bits in the ToS. I spoke to someone very senior within Twitter and they didn't have objections to trying the mass DM approach out. A big part will be if it's done well enough that folks don't mind it.

That said, I tweeted this out yesterday: https://twitter.com/balajis/status/1272431222485106688

image

image

I took the time to write this up as an alternative approach to mass DM. Let's call it the "affiliate link" approach: https://github.com/balajis/twitter-export#the-affiliate-link-approach

See also here for a proposed generic way to score different approaches: https://github.com/balajis/twitter-export#bounty-scoring

epicfaace commented 4 years ago

@balajis Interesting idea -- thanks!