I see a lot of tweeting platforms, which give you the power to send scheduled tweets, retweets, like all the comments for your tweets, always retweet you fav handle, and so on in Twitter. All these come at a cost, most of them are reasonable.
But this got me thinking and I did some surfing around the net. Then I realized Twitter provides free API (of course with a limit) for developers with small apps.
I added my app, started testing the API and I could replicate some of the Awesome functionalities that the paid services could offer.
An interesting thing I did was creating a bot that reads my followers count and appends that to my Twitter profile's Display Name.
Below are some of the few keys steps in achieving thisβ¨
Go to Twitter's developer page and register your app to get the tokens.
All major languages have an add-on/module available for twitter integration. I have used, Tweepy for Python and Twitter Lite for NodeJS.
β‘οΈ Provide the required authentication and clean check the docs for all the available endpoints.After the initial setup is done, the next step would be to get the followers count and writing it to the display name.
β‘οΈ Follower count - this could be fetched from one of 2 APIs,
β¨GET followers/ids β¨GET users/show
β‘οΈ Updated Display Name - to update the profile information to update the use POST account/update_profile by sending the display name with the appended followers count in the name property of the request.Run a cron job which calls and repeats the above steps in the refresh duration that you wantπ
To test more on this implementation, check my profileπ
ππππ ΄π ½ | π¨π»βπ» | 8οΈβ£2οΈβ£1οΈβ£@radnerus93The followers count in my Display Name updates once every minute β¨
If you are not following me, to check if really works, click the follow button, give it a minute and then refresh π€
#100DaysOfCode #DevCommunity14:57 PM - 30 Jun 2020
To look cool, you have multiple pics and use the API to ser them as your display picture at different times of the dayπ₯
Do follow on twitter to get connected and DM me your comments. Since I have just started to write, do send you love and criticism, both would be equally appreciatedπ
Top comments (2)
This is a great tip Suren. Thank you.
Thank you, Vignesh!