brobeurtweet

BroBeur Tweet

Sends tweets for brobeur

In [12]:
from TwitterFollowBot import TwitterBot
import praw
import random
import tweepy
In [14]:
my_bot = TwitterBot()
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-14-fa8d504ee7f0> in <module>()
----> 1 my_bot = TwitterBot()

/usr/local/lib/python3.5/dist-packages/TwitterFollowBot/__init__.py in __init__(self, config_file)
     40         self.TWITTER_CONNECTION = None
     41 
---> 42         self.bot_setup(config_file)
     43 
     44         # Used for random timers

/usr/local/lib/python3.5/dist-packages/TwitterFollowBot/__init__.py in bot_setup(self, config_file)
     80                 line = line.split(":")
     81                 parameter = line[0].strip()
---> 82                 value = line[1].strip()
     83 
     84                 if parameter in ["USERS_KEEP_FOLLOWING", "USERS_KEEP_UNMUTED", "USERS_KEEP_MUTED"]:

IndexError: list index out of range
In [3]:
r = praw.Reddit('brobeurtweet')
In [4]:
subredz = ['DevBlogs', 'gamedev', 'gamejams', 'Games', 'gaming']
In [5]:
randsubrepo = random.choice(subredz)
In [6]:
hashthi = ('#' + randsubrepo)
In [7]:
rgvz = r.get_subreddit(randsubrepo)
In [8]:
rgtnew = rgvz.get_new
In [9]:
ransub = rgvz.get_random_submission()
In [10]:
rantit = ransub.title
In [ ]:
 
In [11]:
randurl = ransub.url
In [12]:
my_bot.send_tweet(rantit + ' ' + randurl + ' '  + hashthi)
Out[12]:
{'contributors': None,
 'coordinates': None,
 'created_at': 'Mon Aug 10 14:45:58 +0000 2015',
 'entities': {'hashtags': [{'indices': [131, 138], 'text': 'gaming'}],
  'symbols': [],
  'urls': [{'display_url': 'reddit.com/r/gaming/comme…',
    'expanded_url': 'http://www.reddit.com/r/gaming/comments/3ggi8h/i_dont_intend_for_this_post_to_get_anywhere_this/',
    'indices': [108, 130],
    'url': 'http://t.co/pXAOfvf7oI'}],
  'user_mentions': []},
 'favorite_count': 0,
 'favorited': False,
 'geo': None,
 'id': 630751950212984832,
 'id_str': '630751950212984832',
 'in_reply_to_screen_name': None,
 'in_reply_to_status_id': None,
 'in_reply_to_status_id_str': None,
 'in_reply_to_user_id': None,
 'in_reply_to_user_id_str': None,
 'is_quote_status': False,
 'lang': 'en',
 'place': None,
 'possibly_sensitive': False,
 'retweet_count': 0,
 'retweeted': False,
 'source': '<a href="http://brobeur.com" rel="nofollow">brobeurtweet</a>',
 'text': "I don't intend for this post to get anywhere, this is just a PSA for anyone who plays the game Organ Trail. http://t.co/pXAOfvf7oI #gaming",
 'truncated': False,
 'user': {'contributors_enabled': False,
  'created_at': 'Sat Mar 30 01:44:05 +0000 2013',
  'default_profile': False,
  'default_profile_image': False,
  'description': 'Video Game Development. #gamedev #linux #getsdrawn',
  'entities': {'description': {'urls': []},
   'url': {'urls': [{'display_url': 'brobeur.com',
      'expanded_url': 'http://brobeur.com',
      'indices': [0, 22],
      'url': 'http://t.co/KRO9XPRA01'}]}},
  'favourites_count': 7,
  'follow_request_sent': False,
  'followers_count': 565,
  'following': False,
  'friends_count': 632,
  'geo_enabled': False,
  'has_extended_profile': False,
  'id': 1315550370,
  'id_str': '1315550370',
  'is_translation_enabled': False,
  'is_translator': False,
  'lang': 'en',
  'listed_count': 16,
  'location': 'Hamilton, New Zealand',
  'name': 'BroBeur.com',
  'notifications': False,
  'profile_background_color': 'C0DEED',
  'profile_background_image_url': 'http://abs.twimg.com/images/themes/theme1/bg.png',
  'profile_background_image_url_https': 'https://abs.twimg.com/images/themes/theme1/bg.png',
  'profile_background_tile': False,
  'profile_banner_url': 'https://pbs.twimg.com/profile_banners/1315550370/1431862528',
  'profile_image_url': 'http://pbs.twimg.com/profile_images/487211737284739072/HBzP949-_normal.png',
  'profile_image_url_https': 'https://pbs.twimg.com/profile_images/487211737284739072/HBzP949-_normal.png',
  'profile_link_color': '300808',
  'profile_sidebar_border_color': 'C0DEED',
  'profile_sidebar_fill_color': 'DDEEF6',
  'profile_text_color': '333333',
  'profile_use_background_image': True,
  'protected': False,
  'screen_name': 'brobeur',
  'statuses_count': 656,
  'time_zone': 'Auckland',
  'url': 'http://t.co/KRO9XPRA01',
  'utc_offset': 43200,
  'verified': False}}
In [13]:
my_bot.auto_rt("#gamejams", count=1)
error: Twitter sent status 403 for URL: 1.1/statuses/retweet/630633343676194816.json using parameters: (oauth_consumer_key=KdTAefyvNji8T1SjMLPKffkpP&oauth_nonce=7184996403309253260&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1439217960&oauth_token=1315550370-HfN0yyyApoowMKSL9SZKiHSezT77LveocL3e3SI&oauth_version=1.0&oauth_signature=d3dfx65hmHl5jTd33zdVZEAsCcg%3D)
details: {'errors': [{'code': 328, 'message': 'Retweet is not permissible for this status.'}]}
In [67]:
my_bot.auto_follow("#gamedev", count=1)
followed abinash_assam
In [ ]:
 

Comments

Comments powered by Disqus