2 min read
No, this is not another article which tells you what Free Basic is and frankly if you are reading this and you don’t know about what Free Basic is then probably you are one of those who agreed for it because all of your friends on facebook were doing it.
First know what free basic is and then register for it , because this is not one of those posts which says “1 like = 1 prayer ” . This decision of yours is gong to affect the whole country . Having said that , this post is not at all about what free basic is , it’s more about what you can do , as a student I can make people aware about how bad the situation is .
The best way to do that is posting things about Free Basic and net neutrality . People will read and they just know what is wrong with Free Basic. Here comes Python into picture , since I love python I wrote a small script that fetch all tweets with #SayNoToFreeBasic and retweet it which automatically gets on my facebook wall. So to beat them at their own game. I user python-twitter and tweepy libraries there was this necessity for two libraries because one is good with meta-info like id etc the other is good with making api calls.
The following is my code , use it well and use it widely
May the force be with you ……… ALWAYS
favorite_hashtags = ['#saynotofreebasics','#SayNoToFreeBasics'] def follow_user_hashtags_fav(status_object): user_dict = dict() user_dict = status_object.AsDict() tweet_id = user_dict.get('id') user_name = user_dict['user']['name'] user_id = user_dict['user']['id'] api_tweepy.retweet(tweet_id) print "Retweet Done!" api.CreateFavorite(status_object) print 'You favorited this tweet : \n',status_object.text api.CreateFriendship(user_id) print 'You are following : \n',user_name api_tweepy.retweet(tweet_id) print "Retweet Done!" for hashtag in favorite_hashtags: print 'For hashtag : \t', hashtag list_statuses = api.GetSearch(hashtag) for status in list_statuses: try: follow_user_hashtags_fav(status) except twitter.error.TwitterError: print "Some Error may be you favorited it twice or you are following yourself" except tweepy.error.TweepError: pass
Did you find this article valuable?
Support Farhaan Bukhsh by becoming a sponsor. Any amount is appreciated!