def tweet_creator(subreddit_info):įor submission in subreddit_info.get_hot(limit=20): So now we have to define a function that gets the list of posts and there urls from Reddit for us. This method connects with Reddit and gets the subreddit of our choice and then returns that subreddit for us to work further with. R = praw.Reddit('yasoob_python reddit twitter bot ' Print " setting up connection with Reddit" Now we have to initiate connection with Reddit. First of all we will have to import the required libraries and set up some basic variables: import prawĪccess_token_secret = 'YOUR ACCESS TOKEN SECRET HERE'Ĭonsumer_secret = 'YOUR CONSUMER SECRET HERE' You will have to edit the permissions for your app under the settings tab and grant your application read and write permission. So first of all you will have to register an app on and after registering copy the Tweepy - (Twitter python API) pip install tweepy.Requests - (HTTP library) pip install requests.Praw - (Reddidt API wrapper in python) pip install praw.Reddit is a social link sharing site where good links are upvoted and bad links are down voted. What this bot will do is that it will copy post titles and url from any subreddit that you want and then it will post them to twitter keeping the 140 characters length in mind.įirstly let me tell you what Reddit is. In this post I am going to teach you how we can make a Reddit + Twitter bot. Source Making a Reddit + twitter Bot September 14, 2013
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |