twitter-export icon indicating copy to clipboard operation
twitter-export copied to clipboard

Submit your bounty entry here

Open balajis opened this issue 4 years ago β€’ 66 comments

See here for context on the bounty for an open source tool to export your Twitter following and here for notes on what one possible solution might look like.

Please submit your bounty entry by adding a comment below. Keep your entry as a single comment, and include the following:

  1. link to your website or repo
  2. example image or video showing the code working on an account

Feel free to edit your comment later if you want, but please don't add more than one comment as spam.

We plan to review this by end of day on June 21, 2020 at 11:59pm PT but may extend the deadline if there are a lot of submissions or unanticipated complexities.

UPDATE: we'll extend this to June 28, 2020 at 11:59pm PT given all the interest.

Update: June 28, 2020 - Review has begun

Wow! Review has begun.

So many awesome submissions by everyone. It will take us a little while to go through them, but we have begun the review process. Please feel free to reply with any questionsl

balajis avatar Jun 14 '20 13:06 balajis

Here is a GIF for a PoC for CLI app: The current CLI app can filter users through complex queries to select specific users (above 1000 followers, etc.) I'm working on the Dashboard now & will keep updating this comment as I make more progress.

twitter-dms

Update 1

A Mock Flow for Dashboard UI (Youtube Video)

Update 2

Code is open-sourced here: https://bit.ly/MarketingBird

Under heavy work...I'll add more context about how will the CLI, and hosted version would work in the README soon. If I have time left till the bounty closes, I'll go for an electron app too! (If this project takes off, we'll shift the stack to Flutter for all-in-one platform coverage)

We don't have a good name for it yet :sweat_smile: Feel free to contribute :wink:

Update 3

Some results of using the CLI tool. Signups on simpleaswater.com skyrocketed due to the DMs. Best day ever :partying_face:

members

Update 4

With the current stack, we can fetch 100 followers in about 4-5 secs (running on my laptop). So, doing the math:

Follower count      Est time to fetch
10k followers       400 secs to 500 secs
100k followers      4000 secs to 5000 secs

Update 5

Able to fetch all public data associated with an account and list/rank them using different parameters. Here is how the public data of a single account looks in raw form:

16473957 | Dr. Tayo Oyedeji | @tayooye | Private: 0 | Verified: 0 | Bio: Founder/CEO at @overwoodng (http://overwood.ngΒ ) | Former corporate CEO & university professor  | I help people manage their money. | Location: Nigeria/USA | Url: http://www.overwood.ng | Joined: 26 Sep 2008 1:20 PM | Tweets: 4211 | Following: 392 | Followers: 92384 | Likes: 1614 | Media: 271 | Avatar: https://pbs.twimg.com/profile_images/1091079425624600576/M_ZJ-MN8_400x400.jpg

vasa-develop avatar Jun 14 '20 19:06 vasa-develop

I coded this Python library. It can extract the followers through the anonymous API. It might be useful...

image

https://github.com/labteral/bluebird

brunneis avatar Jun 14 '20 22:06 brunneis

Working prototype built with Node (TypeScript) if anyone would like to work together: https://github.com/bconnorwhite/twitter-dm

Currently have a basic CLI wizard working. Both follower data and API cursors are saved in a state file incase the script is stopped.

Can add full follower data export (name, location, account creation date, follower count, verified status, etc.), filtering based on these parameters, and a slick webapp, but only if others want to contribute so we end up with one or a few good tools rather than 20 half baked solutions.

dm screenshot

bconnorwhite avatar Jun 15 '20 01:06 bconnorwhite

Hi @bconnorwhite and @balajis , I'm also working on Node-based version, along with Express-driven front-end.

Nice work, @vasa-develop !

Will update as I progress.

cmaer avatar Jun 15 '20 04:06 cmaer

Update 6/27/2020, 11:45pm Alaska time!

What a couple of weeks! I want to thank @balajis for lighting such a great fire under my rear, as I have done more hard core development and learning in the last 2 weeks than certainly any time after about January 20 of this year. So grazie for that. I had hoped to have my working app online, but as I switched mid stream from Node.js to Python, deploying the my aiohttp app with all of the awesome power of the scraping scripts combined with the official API turned out to be harder than I realized. It will be live within a few days after the Digital Ocean guys get back to me! But for now I'll leave you with my screenshots and my thoughts. This app requires only a Twitter login from the user, with no need for their own API keys.

I spent a lot of time thinking about how you determine which followers to direct message first, given that somebody with 100,000 followers is looking at that taking 3 whole months to do. For people with really big followings, achieving a sorting ranking algorithm becomes vital. This is what lead me to abandon the Node.js app you see in these screenshots! To arrive at a meaningful value for which followers you should DM first, a simple sort by followers is extremely insufficient. In fact, some of the followers with a smaller following may indeed have a much more powerful reach, as seen in the amount of likes and retweets you see in their timelines.

The official free API limits you to just 20 or so tweets, and just 1 week of history. The paid API moves that up to 30 days and more tweets - but that's still just not good enough. People go on vacation, or get busy. So tweets will need to be scraped, and luckily Python has some fantastic tools like Twint that will do that for you. Twint does a much better job at getting tweets than getting your followers, and the official API is actually pretty good at doing that within a few hours even for an account with 200,000 followers. But you need the scraping tools to also collect somewhere between 50 and 100 tweets per user, in order to use them in the ranking algorithm.

I envision a user defined ranking where you can play with the settings a little - giving more or less weight to things like being verified, quantity of followers, ratio of followers to friends, and the average amount of likes and retweets per tweet. You could segment that further if you want to categorize by subject parsed from their content.

You can also check engagement in your own feed. People who have mentioned you will be far more receptive to a DM from you than a follower with 1 million followers who has never mentioned you or given you a RT. The scraped data will be the key for all of these metrics.

I built a rather playful UI, as my background is in education - sorry about that! But here are some of the pages I put together, with a backend built both in Node.js and later in Python (luckily I used Nunjucks templating which transferred perfectly to Jinja2) - with data stored to Redis, although eventually there would need to be both a server side and client side database - I like LevelUp a lot, but don't know if it's the most stable thing to use, so I'd ask around before settling on that. At any time the user can export all of their data to CSV, XSL, or JSON as well.

index

I just picked some random copy for the home page, may not be quite right but I want the app to do MORE than just export your following: I want it to help people grow their social media presence wherever they may want it, via Twitter, their blog, FB, etc.

settings

My idea for this placeholder page is to integrate my own meme maker which generates art for social media using a database I've developed of around 60,000 vector images that can be used to quickly make a cool graphic. It's a huge update to kwippe.com - and the idea here is that the user can craft a really great public page customizing the colors, graphics, fonts, etc. They can also generate images to use in campaigns, as ads may end up being an effective tool, like the ones Bill Gates runs that encourages people to sign up for Gates Notes

dash1

My dashboard is a bit spreadsheety, and that can be made spiffier - but I wanted a quick way to get at the followers (and friends, which will be in a separate tab). This is where the "reach ranking" will be key, and you'll be able to select 1000 more people to DM, and that will be entered into Redis. I also intended to add a shiny STATS section to the top, with things like total followers, total likes and retweets, total reach, etc.

dash2

The page above just shows how you can search throughout the fields. It looks in the description, as well as their screen name and full name, but once you have tweets indexed for the users, you could also choose to include all of their tweets in your search. Twitter offers NO easy way to search just your own followers or friends, so this is a feature I would actually like to use myself just to manage my timeline better.

dash3

When you click on a user's picture - it pulls up their 20 tweets going back 7 days from the official Twitter API. The Python app will try to have much of that data scraped either in realtime, or as a task that keeps going even after you log off. Finding an efficient way to do this without taking up too much memory, bandwidth, etc - is something that would have to be looked at. You could opt to send emails to the user when their data is done filling out, and their metrics are updated.

While I see some beautiful work has been done on the DM campaign, as well as generating affilate links - and those could be integrated here - the other thing I thought about if you wanted to grow your Twitter following as well as export users, is using a hashtag incentive. Here I'm not sure if you could get enough data from the official API, or if you would want to use the scrapers. The app can use both.

Offer users the incentive that if they RT your stuff and include their own username plus a chosen keyword - let's say #myhandle$$camogli$$ - that for every RT they generate, they earn points on your leaderboard. Then you just have to check your own RTs and see which usernames are found in the hashtags with those keywords. Just a thought!

Great job to all - I've seen some really awesome stuff here on this thread, and I know how hard folks have worked. Good luck to all and I hope you find a good solution to your issue.

mspanish avatar Jun 15 '20 07:06 mspanish

I'm working in this challenge too. I'm very excite to learn a lot 🀩 and create an excellent solution that can win the bounty.

I bet the competence will be hard, especially because @vasa-develop is working in his repo since 2015!!

Good luck for everyone πŸ˜„ and thank you to @balajis for making this possible! 🌟

ricardopolo avatar Jun 15 '20 07:06 ricardopolo

For any clarification or demo, send email to [email protected]. Will respond to your request as soon as I can.

TwitterDM

The Jupyter notebook that acts as a local application that can send Direct Messages (DMs) to all of your followers based on the keywords in their bio and/or count of followers they have. It allows you to update your followers list with new followers whenever you want to and add these to the list of followers whom you want to send automated DMs to.

This works without any issues for twitter accounts with huge followers. (tested with an account having ~450k followers, but would work for even bigger accounts as well.)

Prerequisites:

  1. Jupyter notebook

How to:

  1. Download the 'Twitter DM application.ipynb' file to a local folder.
  2. Fire up Jupyter notebook application and open the above file.
  3. Update the Inputs cell. Most of the defaults work. Inputs
  4. Run each cell one after other (Cntlr+Enter to run each cell).
  5. 'Install and load ..' cell: installs all prerequsite packages and imports them
  6. 'Backup data' cell: Backs the data as losing it mean running time consuming intial loads.
  7. 'Status Visual' cell: Give a visual representation of followers count, DB status and DMS sent etc. See the screenshot below: Sample status chart
  8. 'Update Follower IDS list' cell: Updates any new followers from last run. Intial run will load all follower IDs in Ids table. 220k records
  9. 'Update metadata' cell: Updates metadata like bio, followers count and so on for the followers. meta data
  10. 'Send DMs for today' cell: Filters, Sorts, choose and sends the number of DMs you want to send on a particular day. DMsent1

DMsent2

Benefits:

  1. Works across windows and MAC as it is a jupyter notebook. The size of the application is 12kb (very lite application)
  2. Works locally, with flatfiles as backend tables. (can be updated to SQLite, but flatfiles seem just fine)
    1. The Twitter API keys need not be shared with anyone
    2. No worry of your followers data being with a 3rd party
  3. Ability to choose the N followers to send the DMs on any given day based on filters you provide like follower count, keywords in bios, exculded list of followers and so on.
  4. Easy to backup data.
  5. Visually check the following counts:
    1. Followers count at the precise moment
    2. Followers count that have been loaded in local tables
    3. Followers that meet the filter criteria
    4. Followers for whom we sent out DMs (that succeeded and failed)
    5. Followers for whome we can still send the DMS
  6. Update tables with new followers and thier meta data with a click of a button.

First time load times:

  1. With accounts less than 75k followers: ~20-25 mins
  2. With accounts less than 150k followers: 40-45 mins
  3. With accounts less than 225k followers: 60-65 mins
  4. With accounts less then 300k followers: 80-85 mins and so on......

Subsequent load/run times are very minimal (under a minute).

Planned Updates:

A Saas tool as follows:

  1. Create a frontend UI that works on twitter login and takes in inputs via a form. Same inputs as above.
  2. Takes to a dashboard that shows the status of your sent DMs and other related metrics.
  3. Ability to schdule DMs.

sandeepvellanki avatar Jun 15 '20 12:06 sandeepvellanki

Here is my submission

Code: https://github.com/daisy1754/tw-megaphone Hosted version: https://tw-megaphone.herokuapp.com/

It's a rails app that can be easily deployed to heroku or run locally. I'll also provide hosed version but given twitter has per-app DM limit you may just deploy your version on heroku

  1. Twitter login
  2. Sync your follower (5000 followers per 15min)
  3. Tweak ranking strategy via UI
  4. Test send DM to specified follower. Web app also provides a per-user unique link to collect email but you can also embed your own email subscription email
  5. Schedule daily job to send DMs (1000 per day)
  6. Provide export (especially useful if you use built-in link to collect emails)

Screen Shot 2020-06-17 at 9 10 11 PM Screen Shot 2020-06-17 at 10 01 39 PM Screen Shot 2020-06-17 at 10 35 37 PM Screen Shot 2020-06-21 at 12 14 16 PM Screen Shot 2020-06-23 at 10 39 22 PM

daisy1754 avatar Jun 15 '20 16:06 daisy1754

These past two weeks have been pretty fun, and @DeveloperHarris and I have definitely learned a lot. Thank you to everyone involved!

Project Pineapple is a collection of tools that we've been working on to address this competition. So far, our CLI tool is completed and our email web app and electron desktop application are still under work.

All the source code is available under an MIT license at https://github.com/DeveloperRyan/project-pineapple.

Project Pineapple CLI - Finished:

2020-06-28_00-34-20

Features:

  • Strong focus on locally stored information, no data stored online giving the user full control.
  • Intuitive and visually appealing CLI menu, allowing anyone to use it
  • Config file that stores Twitter API app keys allowing for a quick startup
  • Local SQLite database creating a seamless setup process
  • Ability to view all total followers and download or "sync" the information locally.
  • Automatically handles API rate limits allowing a person to run once and forget
  • Export all downloaded follower information to CSV, with the option to only pick selected columns if preferred.
  • DM all followers w/ message preview and confirmation
  • DM test user w/ message preview and confirmation
  • Message parsing through handlebars.js allowing {id}, {screen_name}, {followers}, {friends} and other data to be used in messages for personalization
  • Reset config and followers database quickly through dedicated command

Setup:

  • Clone repo
  • With Node installed, run npm i in the project-pineapple\cli folder
  • When complete run node ./index.js

Pineapple Project - Electron Local App - Under Construction:

Planned Features:

  • Easily visualize followers
  • Create dedicated campaigns targeting specific groups of users with customized messages
  • Comprehensive dashboard providing quick-glance overview of profile and campaign stats
  • Many, if not all the features of the CLI

Auth Dashboard Follower DB Campaigns Campaigns-modal


Pineapple Project - Email List / Referral Webapp - Early Stage Construction

Planned Features:

  • Login with Twitter
  • Create an email list w/ dedicated referral link to use
  • When a user clicks email list referral link, ask them to sign in and ask explicit consent to join the email list
  • Give signed up user, personal referral link to share with other potentially interested users
  • When follower refreshes email list page they can either remove themself from the page or see the current scoreboard

We plan on continuing these projects (after a short break) to increase our portfolio and add to our resumes. Please let us know any feedback you have, and any features you would like to see. If we receive enough interest, we might spin this out into a more fleshed out open-source project.

ryandotelliott avatar Jun 15 '20 18:06 ryandotelliott

2020-06-15T18:13:16Z: Working on this after my work time.


TwExodus

(Link to repo)

My project takes care of the stealthiness required to do this follower base exodus. A prototype mostly functional is at the src/unstable directory.

Not only it does send Mass DMs, it can also extract email addresses from DMs and dump these in a CSV file for easy importing.

If you require help at testing it, I am available at Twitter/Facebook/Instagram/LinkedIn using the same username I'm using here at GitHub.

IvanMontillaM avatar Jun 15 '20 18:06 IvanMontillaM

Here's a pretty robust Node.js solution: twitter-flock.

It uses Twitter OAuth and stores the state of each BatchJob in a serializable, resumable format in order to be as robust as possible.

It also includes a simple Workflow abstraction for aggregating sequential BatchJob tasks in the same serializable and resumable format.

I'll be using Saasify to turn this core functionality into a full, hosted SaaS product. You can think of Saasify as a Shopify for SaaS that handles all of the tedious OAuth, billing, and boilerplate for SaaS products like this.

Some basic stats:

  • Exports the user ids for all of your followers (~75k every 15min)
  • Resolves those user ids to full user objects (~90k every 15min)
  • Sorts users based on a basic metric of popularity
  • Sends templated DMS (1k per day)
  • Supports exporting state to disk or db and pausing / resuming processing

I don't think the DM approach will be the best solution as discussed in #3 and #4, so I'm currently working on an alternative approach that tries to infer emails for Twitter users (like an MVP of clearbit which is a very difficult sub-problem in and of itself).

Twitter Flock
Screenshot of an example DM (handlebars template is used for the message body)

I'll be updating this comment with progress over the next few days.

Happy to collaborate on the OSS repo if anyone's interested. πŸ”₯ πŸ˜„ πŸ”₯

transitive-bullshit avatar Jun 15 '20 18:06 transitive-bullshit

Flybird Desktop App

The Flybird desktop app runs on Mac and Windows and automates sending of direct messages to your Twitter followers, with a focus on soliciting newsletter subscriptions. Keep your API keys on your own machine, send up to 1000 messages per day.

GitHub repo at https://github.com/treylorswift/FlybirdDesktopApp

Flybird Web App

The Flybird web app provides users with a quick and simple way to create a newsletter sign up page at https://flybirdy.herokuapp.com. It tracks all your subscriptions as well as the referrer responsible for generating the sign up. The "Referrals" tab shows you who has brought the most subscribers to you.

GitHub repo at https://github.com/treylorswift/Flybird

Desktop App Features

  • Cross platform application built using Electron & Node.js

  • Downloads your complete follower list from Twitter at roughly 300k followers per hour. Download can be resumed later if interrupted. Followers can be updated/re-downloaded again later.

  • Followers are displayed in a table and can be sorted by "Most Followers" (your most influential followers) or "Most Recently Followed" (the people who followed you most recently). Filter results by entering tags which will be matched against each user's Twitter bio.

  • Message composition has a primitive template engine which allows the user to insert the follower's Twitter handle into the message wherever they want. The intended use case is to insert the follower's Twitter handle in the referral id of a newsletter sign up link.

  • Message sending history is tracked to ensure each follower is contacted only once. Message sends are scheduled to avoid hitting Twitter API rate limit errors.

  • A separate "Sandbox" message history allows you to simulate sending of messages to see how the program operates without sending real messages.

Integration with Flybird web app

The default outgoing message directs followers to the user's subscription page with a unique referral code for the follower. For example if you are 'treylorswift', the default outgoing message will be:

Hey there, are you interested in receiving my newsletter?

You can sign up at https://flybirdy.herokuapp.com/subscribe/treylorswift?twRef=${followerTwitterHandle}

When messages are sent, the follower's Twitter handle will be included in the link. They can share this link with their audience and they will receive credit for anyone who uses the link to sign up.

For example if I send the above to @balajis, he will receive the link https://flybirdy.herokuapp.com/subscribe/treylorswift?twRef=balajis

If he shares that link with others, and others use that link to sign up, he will get credit on the referrals leaderboard displayed on the Flybird web app.

Pre-Built Desktop App Binaries

Developer Install

  • Instructions are on the github page at https://github.com/treylorswift/FlybirdDesktopApp/#developer-install

Further work being considered:

  • A "hosted site" version of the above Electron app where people can login with their Twitter account and get right to work.

  • Expand on the template variables that can be used in the outgoing DM's to customize each message further.

  • Allow users of ITK Sign Up to provide an API key to kickbox which can score email addresses submitted to the sign up engine

Command Line Tools

My command line follower downloading, caching, and message sending engine (the same engine underlying the desktop app) is currently located here:

https://github.com/treylorswift/InfluencerToolkitCLI

updated June 24th with new desktop app, newsletter sign up web app, and improved back-end / command-line engine

updated June 26th with the ability to send unique sign up links (with referral id's) to every follower

updated June 28th with an improved subscriptions management UI and new name and logo

treylorswift avatar Jun 16 '20 14:06 treylorswift

Just seeing this, will be back in few days

OlabodeAbesin avatar Jun 16 '20 23:06 OlabodeAbesin

Nice work everyone. Am looking at these over the next few days along with other submissions as they come in.

Please also take at this writeup on a complementary affiliate link approach: https://github.com/balajis/twitter-export#the-affiliate-link-approach

As well as this proposed scoring mechanism: https://github.com/balajis/twitter-export#bounty-scoring

It's possible to combine the mass DM and affiliate link approach by sending a mass DM to a selected subset of people, each of whom gets a custom signup and affiliate link. @thumpri put together an excellent infographic on this: https://github.com/balajis/twitter-export/issues/9

To answer a recurring question, any email list we get can be exported/imported to any site given the consent of the users (here's how that works for Substack.

One thing we're thinking about is how to give folks partial credit. One possible approach is that the $10k bounty goes to the final tool, and the remaining funds are split to give individual prizes to folks whose code or writeup helped contribute to the answer. The overall goal is that everyone learns something and has fun by participating, of course.

balajis avatar Jun 18 '20 12:06 balajis

Hey everyone, love all the submissions in here!

Gave this challenge a try with a web app that:

  1. lets you provide database credentials and twitter credentials
  2. logs your followers to that database
  3. lets you message them

Code

https://github.com/shea256/movement-for-twitter

Live App

NOTE THE APP WILL NOT WORK UNTIL YOU SET THE DATABASE AND TWITTER CREDENTIALS ON THE SETTINGS PAGE - THIS WILL BE SIMPLER IN A FUTURE VERSION

https://movement.vercel.app/

Screenshots

Dashboard:

Screen Shot 2020-06-18 at 11 08 32 AM

Followers:

Screen Shot 2020-06-18 at 12 27 33 PM

Settings:

Screen Shot 2020-06-18 at 12 31 45 PM

Future Work

Logging

The logging experience is a bit janky for now, so I recommend carefully reading the instructions in the README.md. Even better, I recommend running the app locally and watching your console logs so you know when the logging has completed. This limitation is just temporary. I plan on spending another day or so on it to create a queue that will log all of the followers in a more reliable and convenient way.

Messaging

The message feature currently only lets you message one person at a time and it doesn't show you a history of the people you've already messaged. A future version will have support for this.

shea256 avatar Jun 18 '20 16:06 shea256

An implementation using Python: https://github.com/JordanDworaczyk/Twitterbot

help_connect

Summary

Twitterbot consists of a command line interface for downloading followers, ranking followers, and then sending out a message to each follower based on their priority which is determined by their ranking.

Using Twitterbot a user can download up to an estimated 75,000 followers every 15 minutes and send up to 1000 direct messages each day.

ghost avatar Jun 20 '20 09:06 ghost

Hey everyone, great submissions!

Here is my webapp with the salient points:-

  1. Can survive bad internet and run for any number of days
  2. Keeps all followers cached locally (easily works for 100k followers)
  3. Has a webapp to explore dataset as well as see status
  4. Support sending DMs

Code

https://github.com/MohitKumar1991/twitter-export

ezgif-6-bde1c9f707b4

Planned for Next Week:-

  1. Fix bugs and improve overall stability
  2. Improve UI
  3. Message History & export followers

MohitKumar1991 avatar Jun 21 '20 21:06 MohitKumar1991

Hey guys,

I created a python CLI and GUI app for the DM Link Approach

Please feel free to contribute or clone the repo to add improvements

I am open to collaborating for a web app for the DM Link Approach or a new solution for the Affiliate Link approach.

I am attaching the code below https://github.com/CodeHownd/twitter-export-followers

image

GUI demo https://streamable.com/5t7oqd

davidyashgur avatar Jun 22 '20 16:06 davidyashgur

Twitter Blast

Sup guys, these submissions looking πŸ”₯ so far!

Here's my solution to the mass DM approach: https://github.com/drizzleco/twitter-blast

Here's the hosted version: https://twitter-blast.herokuapp.com/ (πŸ‘ to @fangherk)

My solution uses Python, tweepy, Flask, and SQLAlchemy. Check out the README in the repo for more in-depth documentation. Questions and suggestions are welcome!

CLI Version

twitter blast

Flask Version

twitter blast the dropdown menus didn't show up on the recording for some reason :(

Features

  • easy authentication using Sign in with Twitter
  • preview follower rankings before sending the real deal
  • defaults to dry run mode to prevent unintentionally sending out DMs
  • remembers when a DM has been sent to a follower so no unintentional double sends
  • automatically pauses execution to wait out rate limits

Getting Started(CLI version)

  1. make install to install dependencies

  2. Edit secrets.py(automatically created) in the same directory as twitter_blast.py and add your app credentials:

    • make sure your Twitter app has "Read, write, and Direct Messages" permission
     HOSTED_CONSUMER_KEY = "" # for the flask app
     HOSTED_CONSUMER_SECRET = "" # for the flask app
     CONSUMER_KEY = "" # for the CLI version
     CONSUMER_SECRET = "" # for the CLI version
     SECRET_KEY = ""
    
  3. On first run, you'll be prompted to authorize with Twitter

     $ python twitter_blast.py
     Visit to authorize with twitter:  https://api.twitter.com/oauth/authorize?oauth_token=_______________________
     Paste the verification code here: ________
    
  4. python twitter_blast.py fetch to fetch your followers

  5. python twitter_blast.py preview to test out the ranking system and see how your followers will be prioritized

  6. python twitter_blast.py send to dry send a DM to your followers(add --real to send them for real!)

Getting Started(Flask version)

  1. Complete steps 1 and 2 from above.

  2. Add http://127.0.0.1:5000 to your callback URLs in Twitter dev app settings

  3. make start

    OR

  1. source .venv/bin/activate && python app.py

Behind the Scenes

  • Fetching followers data
    • fetches ids of followers first using followers/ids
      • followers/ids returns 5,000 user ids/request(max 15 requests every 15 minutes )
      • TOTAL: 75,000 users every 15 minutes
    • then, fetches user object using users/lookup
      • users/lookup can get 100 user objects per request
      • with user-level auth, you can make 900 requests every 15 minutes
      • TOTAL: 90,000 users every 15 minutes
  • Ranking Followers
    • uses SQLAlchemy database queries to do the heavy lifting
  • Sending DMs
    • uses tweepy's wrapper for direct_messages/events/new (message_create)
    • updates database to keep track of which followers have been sent DMs

petabite avatar Jun 22 '20 22:06 petabite

I created a web app based on the referral link approach: https://socialexporter.web.app/

Code: https://github.com/moesalih/socialexporter

socialexporter-home

Once an influencer logs in with their Twitter account. A public page gets created to ask their followers for their emails. And the home page shows the link to that page and some other links to export all follower emails to a text file, see the referral leaderboard, and change settings.

socialexporter-loggedin

When a follower opens that public page, they get a simple email form to sign up, and once they do, they see a custom referral link to the same page they accessed and get assigned a follower ID.

Here's my public sign up page: https://socialexporter.web.app/moesalih_

socialexporter-userpage socialexporter-userpage-after-signup

The follower can share this custom referral link with others, and get credit for anyone who signs up from that link.

A public leaderboard page will show the top follower IDs and how many others they referred. If this leaderboard is accessed by a follower who submitted their email and referred others, then their follower ID gets highlighted (like bellow). If this leaderboard is accessed by the influencer, then they see the emails of the top followers (in case they want to contact them).

socialexporter-leaderboard

I'd love to hear feedback on what I have so far, and if you have any questions.

This still doesn't include determining the quality of the emails, preventing referral abuse, and the payments part. And there's lots of improvements that can be done, but this is a functional MVP of the approach.

moesalih avatar Jun 25 '20 15:06 moesalih

Hi there!

We (me, @supra08 and @palakg11) have made the submission application at these links -

  1. MacOS App - https://github.com/kanav99/TwitterCampaigns
  2. CLI - https://github.com/supra08/twitter-campaign-cli/
  3. WebApp - http://ec2-54-161-90-135.compute-1.amazonaws.com:8080/

TC0 TC1

See our application in action -


Command Line App -

Web App -

Our app provides an elegant way of reaching the twitter followers with the mass DM approach. This MacOS app has the benefits of native performance giving it an edge over web versions. But for non-mac users we have also prepared solutions. Those tech savvy guys who want to get their hands dirty can use the CLI with loads of features and campaign deployments plans that gives you a quick way to reach your followers. For those who want a quick web solution, we have a react based web version deployed The deployment plans give an extimate duration and you can plan you DMs accordingly. The processes run in background and be paused and resumed at ease. We can modify campaigns with follower specific plans and also verify whether a particular follower has received a DM or not.

kanav99 avatar Jun 26 '20 20:06 kanav99

Hello everyone!

https://outfluencer.co/ is my solution for this challenge! It is a hosted application coded in JavaScript that runs on Node.js and uses MongoDB as a database.

Requirements to use the app

The app requires minimum access permissions (read only) just for the Sign in process. Additionally, to use the tools it provides, you need the following keys (session storage only):

  • Twitter API keys with access permission set to 'Read, write and Direct Messages';
  • Coinbase API key with wallet:transactions:send permission (for enhanced security it is recommended to whitelist https://outfluencer.co/ 's IP address) - note that the rewarding system is scheduled for future development;

Outfluencer.co provides Twitter influencers with the following tools (current working version):

  • Download followers and/or subscribers (people that shared their email) in .csv files βœ“
  • Send automated mass direct messages βœ“
  • Sort and filter data before sending DM (e.g popularity, activity, verified accounts etc) βœ“
  • DM with quick replies options βœ“
  • A public page https://outfluencer.co/subscribe/username where anyone can agree to subscribe and share their email βœ“
  • Referral URL https://outfluencer.co/subscribe/username?aff=username to expand the affiliate network βœ“
  • A leaderboard public page https://outfluencer.co/leaderboard/username with ranked subscribers βœ“

gif

Sign in

You log in with Twitter OAuth, enter your API Keys (session storage) and start extracting your followers. On average, it fetches approximately 3.000 followers/sec for those accounts with less than 75.000 followers, after that, the 15min Twitter API restriction kicks in (max. 75.000 followers/15 min). note: entering your API Keys is mandatory until you extract your follower DB (you'll get an error if your keys are incorrect), after that, you can leave the inputs empty BUT only to see the dashboard (if you want to send DM your keys must be correct).

keys

Dashboard

After the followers have been extracted, you get redirected to the Dashboard where you can download your data as .csv files and have an overview of the numbers behind it.

dashboard

Mass DM

This is where you can sort and filter you followers and start sending mass DMs. I've added some little things to help you write more personalized things, such as writing {{follower}} to insert the follower's name or {{url}} to insert your public page or quick replies in case you expect an answer from the recipient.

massdm

Campaigns

This page acts like history, keeping records of the mass direct messages you've sent, showing some 'must have' details.

campaigns

Collecting valid emails with 3 clicks:

  1. click: the follower gives his explicit consent;
  2. click: the follower initializes the Twitter app;
  3. click: the follower authorizes the Twitter app to share his email address;

Creating this app with the sole purpose of collecting emails was the best approach considering the following:

  • it targets only Twitter users;
  • there is no need for email validation;
  • it eliminates fake signups;
  • in my opinion, it is also compliant with Twitter's Rules and policies, section C. Automated Direct Messages, paragraph Interacting with users via Direct Message that states the following:

If you will be asking a user to provide personal or private information via an automated Direct Message, you must clearly explain how you will use the information you’re collecting. Consider including a link to your privacy policy in your Direct Message to the user, as well as in your Twitter profile bio.

subscribe

authorize note: the follower can subscribe to multiple influencers and the app will ask for authorization each time.

Leaderboard

On this page all the subscribers will be displayed and they are ranked by the no. of people that subscribed as well.

leaderboard

Affiliate

After someone subscribes, they are redirected to this page where an affiliate link is generated.

affiliate

Payment proposals for the rewarding system

1) Automated international payouts by integrating Coinbase's API

From a dedicated page, similar to Mass DM, the influencer will be able to create a New Reward Campaign by setting:

  1. Parameters for the campaign:
  • the duration for the campaign to run;
  • the total amount of bitcoin for the reward;
  • the maximum amount of bitcoin per individual;
  1. Criteria to determine the winners:
  • the number of people to be rewarded (top 3/ top 10 etc);
  1. Write the message for a note that will be included in the email that the recipient receives (from Coinbase); This feature would only be available for higher amounts.

In order to activate the Reward Campaign, the influencer will have authorize it by entering his/hers Coinbase API Keys.

Under the hood, the following steps will be taken:

  • for each campaign created a new bitcoin address will be generated for his/hers primary Coinbase wallet;
  • the total amount of bitcoin will be sent/moved to the newly generated address (it is his/hers own address and the funds come back to the primary wallet);
  • when the reward campaign ends it will start to streamline payouts: sending the maximum amount of bitcoin to the winner's email address;

The pros and cons of integrating Coinbase

Pros:

  • micropayments between Coinbase accounts are free and fast because they are off-blockchain transactions (settled on their internal ledger);
  • it gives the winner the possibility to exchange his/hers winnings to another preferred currency;
  • it only requires the email address (which it was already collected) to make the transaction, eliminating extra steps to collect or generate additional sensitive data (e.g. bitcoin address);

Cons:

  • the winners are required to have a Coinbase account; workaround: since the web app already has a built-in system to send direct messages, for those transactions resulting in an unverified_email error, you could opt to send a direct message informing the subscriber that he/she won and needs to register at Coinbase to claim the reward;

2) Payments by integrating with Tippin.me (not confirmed yet)

fast, international, automated, small payments to users for decentralized work

... it made me think about micropayments with Bitcoin using Lightning Network, more precisely it made me think of the Tippin.me app. I do have limited knowledge in this area, but I'm waiting for a response from Tippin.me to see if it is feasible to build an automated tipping process for the rewarding system and also if they are open for collaboration in this regard.

Future developments

  • Implement one of the above proposed Payment proposals for the rewarding system;
  • Build an opt-out of receiving automated direct messages solution and create a blacklist with followers that did, thus making sending mass direct messages more compliant with the Twitter Rules and policies;
  • Add additional filters to target specific followers (e.g. collected emails, hashtags etc);
  • Admin functionality to allow the influencer to customize his public page;
  • 'Stop button' to stop the automated direct messages from sending;
  • Set up welcome message that will be sent automatically to new followers;
  • A page with data visualizations;

Github repository

https://github.com/snowdot/outfluencer

Final thoughts

This was a fun and interesting challenge and I'm glad to be part of it. I believe that with this project we've only scratched the surface and that there is an immense potential to build great things with the Twitter API.

snowdot avatar Jun 27 '20 01:06 snowdot

Really amazing submissions everyone. I spend a lot of time empathising with the problem and figured out the solution approach as explained through the following mind map and mentioned in issue #9: Follower Export Bounty

While working on the Hybrid approach, I encountered another problem and further modified the solution to the following : 




Hybrid Approach


As explained in the above mind-map, I have built a ranking algorithm which serves the purpose and the code for which can be found here : https://github.com/thumpri/Soporter

While coding the proposed solution, majority of my time was spent analysing the Twitter API and finding loopholes to surpass the limits.
 Following are my findings :

  1. Twitter API Limits Loophole - 5x return speed
  2. Removing the app limits
  3. Get Followers - fastest non-api based method
  4. Get tweets - fastest non-api based method

. These are better explained in the following mind-map.
Findings

I think we’ll have a brilliant tool if we keep this algorithm as the base and add functionalities like- β€’ The front end code by @snowdot or @moesalih β€’ Maintaining an apt database which preserves the state as done by @MohitKumar1991 β€’ generating Auth bearer token for better speed (5x) β€’ Twitter authentication, sending DMs as done by in Python by @petabite and so many others.

I would love to continue working on it as a side project and bring all the pieces together. This has surely been a great learning experience for me to encounter a seemingly easy problem, iterating through several solutions and finding the one that fits (for now!). :D 
 Thank you @balajis for hosting this. I hope I was able to add value to it.

thumpri avatar Jun 27 '20 16:06 thumpri

Eschernode!!!

Messaging Automation for Social Media Influencers XD

https://eschernode.com/

Video Link: https://www.youtube.com/watch?v=4-OiEdxJxKw

Basic overview of the UI. You sign up, update keys, start indexing followers.

Filters And then go to the Filters page. Create whatever targeted segments you think are relevant. Currently the filters I provide are, follower count, friend count, keywords, muted by you, verified, last active, twitter handle to test your messaging campaigns. I have more filters in pipeline.

Campaigns After you create your targeted segment, you start your messaging campaign. There you can enable a custom link or subscription link I provide to send with the message. Using these links I track, clicks and conversions. conversion is when the user successfully subscribed. I built the tracking of conversions and clicks. /subscribe/user link. These things will be shown on a campaign page. I will also be tracking other metrics for the next day after the campaign is sent.

I currently disabled the actual campaign sending part. Its actually scary, its too powerful, worried I might accidentlly send it to all my followers becuse of a bug or etc. I want to test more and then enable it. Also it feels like I over engineered this a little bit in two weeks. I used workers and message passing. Lots of things can go wrong. You can send a test dm tho for now. It's to test right before you start a messaging campaign.

Even though you wont be able to start campaigns, You can sign in and index your followers, and then play with the segmenting your followers. Its really fun. The filters UI came out really well.

If people start using this, I will be implementing A/B testing of your campaign messages, tracking unfollows right after campaigning, more checks to send dms based on whether a follower received a message recently.

Please sign up and let me know if there are any bugs. I hope not!!

Thanks @balajis for hosting this fun product challenge.

I'm really happy with the Filters UX, you add an extra filter by clicking on the plus, and you can delete a filter by clicking on the < next to the filter.

img img Imgur Imgur Imgur Imgur

Update:

link to the cmd line tool I built initially that supports the backend to this webapp https://github.com/syllogismos/balaji

Implementation Details and Technologies Used:

  • React Frontend
  • Django for API
  • gunicorn webserver
  • dramatiq for asynchronous producer consumer implementation
  • rabbitmq for storing messages of dramatiiq
  • elasticsearch for searching twitter users
  • firebase for user auth and hosting the webapp
  • tweepy

syllogismos avatar Jun 27 '20 17:06 syllogismos

JMEL - JoinMyEmailList (jmel.org)

A BTC Affiliate + Mass DM approach

A simple tool to let influencers create a link using which followers can signup to their newsletter and get rewarded in BTC Repo : socionity/jmel

Influencer flow

  1. Influencer signs up with Twitter account, granting full permission to account home

  2. A link gets created, a bitcoin address is generated

  3. Influencer fuels the bitcoin address btc

  4. Influencer types a message that is to be displayed before the users sign up, from the settings tab settings1

  5. Influencer goes to the Invite tab and invites the top 1000 followers by sending them a DM (can be repeated multiple times, over days) invite

  6. Influencer can track who all have signed up on the Subscribers tab subs

Subscriber Flow

  1. Subscriber receives a link join1

  2. Subscriber logsin with a social media account giving permission to access email

  3. Once registered, an affiliate link and a scratch card is generated

  4. Scratch card can be opened once in 24 hours

  5. More the number of people who have registered using the user's link, more the likelihood of winning on the scratch card

  6. Subscriber gives the BTC address and opens the scratch card Screenshot from 2020-06-28 01-08-32

  7. BTC is transferred to the given address. Next scratch card will be available in 24 hours. All affiliate sign ups from this point on will be considered for the next scratchcard's probability.

Self Hosting

  1. Clone this repo
  2. install MongoDB
  3. Create Twitter Apps - one with read write & email permsission, another with read and email permission
  4. Edit config.js
  5. npm start

socionity avatar Jun 27 '20 19:06 socionity

Introducing Rabble, a Flask App developed in Python to send prioritized mass messages to your Twitter followers.

The repo can be found here Github Repo for Rabble: A Twitter App for Mass Messaging your Followers

Rabble: A Twitter Application for Mass Messaging your Followers

Login with your Username

login

Mass Message your Followers

message_proof

Prioritize Mass Messaging using Pre-Sorted Groups

send_message

Sort By Location to Target Specific Followers

sort_by_location

Export your Followers to a CSV File

export_new_york

Link to App

Rabble: A Twitter Application for Mass Messaging your Followers

How it Works

Use this app to gather, sort, and send a message to a database of your Twitter followers. Sort your follower database with 8 unique parameters. Export your followers to a CSV file.

Mass Messaging

Choose how many followers you'd like to reach. Choose a parameter to prioritize them by. Filter by location if you so choose. Write a message and inform your twitterverse followers. Twitter only allows 1000 DM's to be sent per day. With large amounts of followers, this can take a while. Feel free to set it and forget it. This app was designed on a timer with Twitter Rate Limits built in.

Export to CSV

Export your followers from a pre-sorted database to a CSV file. Load time is approximately 90 seconds per 5000 followers, patience is key!

User Guidelines

Users need to ensure they have "Read, write, and Direct Messages" enabled on their app tokens. Twitter Apps

twitter_permissions

Note

Due to heroku timeout limits at 30 seconds, the GIFs above were locally hosted.

npgeorge avatar Jun 27 '20 22:06 npgeorge

Twitter Exporter

Twitter Exporter is designed to be a desktop application with single user in mind. However this solution can be scaled to cloud based solution with added security features like OAuth sign-in and higher performance database with minimal code changes.

Key Features

  1. Security keys and follower data stored on locally on user's system and not shared outside.
  2. Visualisation of fetch subset of follower's information from twitter for analysis before sending DMs.
  3. Multiple filter options to select followers to send DM with subscription links. Currently available filters: a) Filter followers based on their twitter joining date. b) Filter followers based on minimum number of their followers. c) Filter followers based on minimum number of their friends. d) Filter and categorise high value followers (power users) based on maximum number of their followers. e) Filter and categorise high value followers (power users) based on maximum number of their friends. f) Filter followers who are verified by twitter.
  4. Provision to send DM and retry DM after configured number of days. Follower name will be auto filled in DM.
  5. Test functionality to try DM and retry DM on up to 5 configured twitter accounts.
  6. Visualise statistics on screen.
  7. Hover over individual marker on scatter plot to get details about specific follower like number of name, follower count, friends count and DM status.
  8. Option to export data as csv. a) High value follower information currently fetched. High value follower is identified based on their respective follower and friends count. b) Follower information currently fetched. c) DM status with timestamp mapped based on follower id. d) Skipped follower (followers for whom you do not have access to send DM) information currently fetched.
  9. Automated fetch and DM option based on twitter rate limit.
  10. Auto refresh of visualisation and summary.

Git Repo

https://github.com/ShreyasJothish/twitter-export

Configuration and Setup details.

https://github.com/ShreyasJothish/twitter-export/blob/master/README.md

In Action

Twitter Exporter Dash Board with Statistics

Screenshot from 2020-06-28 07-42-12

Individual Follower Overview

Screenshot from 2020-06-28 07-42-35

Data Selection

Screenshot from 2020-06-28 07-42-59

Zoom In

Screenshot from 2020-06-28 08-02-15

Export

Screenshot from 2020-06-28 07-44-04

Future enhancements possible

  1. Support multiple users by integrating with existing web application or new deployment.
  2. Support OAuth based authentication.
  3. Make use of better performance database like PostgreSQL or MongoDB.
  4. Support dynamic configuration updates.
  5. Additional filters based on twitter user information.
  6. Special configurations for high value followers.
  7. Support affiliate link solution.
  8. Word Tokenization and other NLP based filter on follower's description.
  9. Additional visualisations. and much more.

Twitter Exporter is developed on Flask framework and many of enhancement can be achieved with minimal code changes.

ShreyasJothish avatar Jun 28 '20 05:06 ShreyasJothish

Repo: https://github.com/neelsomani/audience-analysis

Hi there! My unique insight for this problem is that many of the posted solutions don't scale to very large numbers of followers. Aside from that, the mass DM approach violates Twitter's TOS and will almost certainly get a user shadow banned or worse.

I built my project with the intent of not violating Twitter's TOS while handling the scalability concerns for accounts with very large (100,000+) followings.

This tool streams a user's Twitter followers (by parallelizing the Twitter API requests across API keys) and infers various attributes about each individual follower, including their email address and LinkedIn profile.

Feel free to take a look at my README, which explains why I think my methodology is best. Here's an image of what the results look like:

Output file

P.S. Many of the submissions are structured as web apps, but they cannot actually function as such for even two users, since the work isn't properly parallelized (especially for users with large followings).

neelsomani avatar Jun 28 '20 09:06 neelsomani

Hello Everyone

I have made multiple improvements over the week and sharing the second version again.

  1. Resilient - Resilient to Internet Loss, App Shutdown, Twitter Rate Limits, Twitter Auth Expires
  2. Support Sending DMs
  3. Export Followers to CSV (or filtered followers)
  4. Affiliate Links with Emails DB (shows who has subscribed to you)
  5. Improved UI

Affiliate Links support tracking entire hierarchy of who recommended you.

twitter-export

In the third week, I will make the app in a very simple deploy to heroku app that anyone can deploy to their heroku account and start work.

I will also add simple analytics, esp around filtering followers by country( not so simple from what response twitter is providing), calculating conversion rates for your links and finding best people who recommended you to their followers.

With my third week work, it will become a complete solution to migrate twitter users to your personal email list.

Link - https://github.com/MohitKumar1991/twitter-export

MohitKumar1991 avatar Jun 28 '20 19:06 MohitKumar1991

Jupiter

πŸŽ‰ Introduction

Jupiter is an electron application built for MacOS/Windows. This application primarily fetches a list of your followers and provides features to send Mass DMs to them.

This app runs locally. It uses SQLite database to save state and record details of who have been contacted and who are yet to be contacted.

πŸ’Ž Features

Jupiter comes packed with the following features:

  • Fetch Followers from Twitter (75000 followers/15 minutes)
  • Create Segments(lists) of followers based on filter criteria (Filter followers with >= 5000 followers or >= 200 tweets)
  • Segments can have multiple AND or OR based filters
  • Create (Mass DM) Campaigns on selected segments with ranking by followers count, bio, tweets, retweets, etc.
  • Set weights (Number of messages to be sent in a day) for each Campaign
  • Schedule your Campaign to send MassDMs at a specific time everyday
  • Pause and Resume Campaigns
  • Send test DMs to upto 5 users from the Campaign settings before the Campaign kicks off
  • Track statistics like number of DMs sent from the app Dashboard

🧱 Architecture

Jupiter Core and UI Architecture

A decoupled architecture where we have an adapter for a given social media platform (Twitter) and connection to external databases through Sequelize ORM enables us to have flexibility with the DB engine used.

The react components used within the electron app are also decoupled from the IPC messaging which enables us to reuse the same components for local/hosted web apps in the future.

πŸ“Έ Screenshots

  • Welcome Screen: Setting up Twitter Keys

settings

  • All Followers Screen: After sync completion

all-followers

  • Create Segment Screen

create-segment

  • All Segments Screen

all-segments

  • Create Campaign Screen

create-campaign

  • All Campaigns Screen

all-campaigns

  • Campaign Followers Ranking Screen

campaign-ranking

  • Send Test DM Screen

send-test-dm

  • Campaign Status Screen

campaign-status

▢️ Demo

Jupiter Demo

https://www.youtube.com/watch?v=PLQT1RAWcMo

πŸš— Test Drive

If you wish to see how the app works in MacOS. You can download our Jupiter GUI Alpha* build here.

:electron: Future Plans

  • Auto-upgrade of standalone application of Jupiter electron apps (handling data-migration, package updates, etc.)
  • Visualization of Followers data and Campaign Statistics
  • Hosted web app built on top of Jupiter - core
  • Combining the Mass DM approach with the Affiliated links approach
  • Static and Dynamic segments with options to import set of followers as a new segment
  • Exporting a list of followers, campaign reports
  • Comprehensive logging options for debugging

πŸ“‘ Repositories

πŸ§™β€β™‚οΈ Contributors

kgkrishnavbi avatar Jun 28 '20 20:06 kgkrishnavbi