pyTweetBot.find_github_tweets

Tweet activities of the repositories of an GitHub account like creation and how many pushes. The tweet will look like this :

I made {n} contributions on {date} to project #{project name}, #GitHub #{project topics}

pyTweetBot.find_github_tweets module

pyTweetBot.find_github_tweets.add_tweet(action_scheduler, tweet_text)

Add tweet through the scheduler

Arguments:
  • action_scheduler: The action scheduler object
  • tweet_text: Text to tweet
Returns:
  • True if ok, False if problem.
pyTweetBot.find_github_tweets.compute_tweet(tweet_text, action_scheduler, instantaneous)

Tweet something directly or add it to the database.

Arguments:
  • tweet_text (unicode): The text to tweet.
  • action_scheduler (ActionScheduler): Action scheduler object of type (pyTweetBot.executor.ActionScheduler)
  • instantaneous (bool): Tweet directly (True) or add it to the DB.
Returns:
  • True if tweeted/added, False if already in the database.
pyTweetBot.find_github_tweets.create_tweet_text(contrib_counter, contrib_date, project_name, project_url, topics)

Create the tweet’s text for a git push event.

Arguments:
  • contrib_counter (int): Number of contributions
  • contrib_date (datetime): Date of the push
  • project_name (unicode): GitHub project’s name
  • project_url (str): GitHub project’s URL
  • topics (list): GitHub project’s topics
Returns:
The tweet’s text.
pyTweetBot.find_github_tweets.create_tweet_text_create(project_name, project_description, project_url, topics)

Create tweet’s text for a git repository creation.

Arguments:
  • project_name (unicode): GitHub project’s name
  • project_description (unicode): GitHub project’s description
  • project_url (unicode): GitHub project’s URL
  • topics (list): GitHub project’s topics.
Returns:
return:The created text.
pyTweetBot.find_github_tweets.find_github_tweets(config, action_scheduler, event_type='push', depth=-1, instantaneous=False, waiting_time=0)

Add tweets based on GitHub activities to the database, or tweet it directly.

Arguments:
  • config (BotConfig): Bot config object of type pyTweetBot.config.BotConfig
  • action_scheduler (ActonScheduler): Action scheduler object of type pyTweetBot.executor.ActionScheduler
  • event_type (str): Type of event to tweet (push or create)
  • depth (int): Number of events to tweet for each repository.
  • instantaneous: Tweet the information instantaneously or not (to DB)?
  • waiting_time: Waiting time between each tweets (for instantaneous tweeting)
pyTweetBot.find_github_tweets.prepare_project_name(project_name)

Replace - by space in the project name and put the first letter of each word to uppercase.

Arguments:
  • project_name (unicode): GitHub project’s name
Returns:
The cleaned project name