Config options

The config file written in yaml. If some values are not in the config reasonable hardcoded defaults are used

Example config with default values:

twitter:

  # Client settings
  # consumer key for twitter api
  consumer_key: null
  # consumer secret for twitter api
  consumer_secret: null
  # access token key for twitter api
  access_token_key: null
  # access token secret for twitter api
  access_token_secret: null

  # The bot will stop when api calls remaining are under
  # min_ratelimit_percent of the max that twitter allows
  min_ratelimit_percent: 10


  # Search for contest settings
  search:

    # Queries to use for searching giveaways.
    # You can set the language for a specific query like this
    # - query
    # - query with language filter:
    #   lang: en
    queries:
      - RT to win
      - Retweet and win
      - Giveaway retweet:
        lang: en
      - "using #hashtags need quotes"

    # Will skip all retweeted post until it finds a new one
    # Be ware, that it may use many api calls
    skip_retweeted: false

    # Max tweets that holds the bot in memory to post
    max_queue: 100

    # The maximum quotes that will be recursively search
    # for the original tweet
    max_quote_depth: 20
    # Some tweets are quotes of another tweet
    # This is the mimimum similary between the quote and the post
    min_quote_similarity: 0.5

    #Plugins to filter tweets
    filter:
      # Filter out tweets that have less retweets than `number`
      min_retweets:
        # If this filter method is enabled
        enabled: true
        # If a tweet has less retweets than this number, dont retweet
        number: 20
      # Filter out tweets that contains some criteria
      blacklist:
        # If this filter method is enabled
        enabled: false
        # keywords that if a posts contains would be filtered
        # leave it empty if you want to disable keywords
        keywords: ["obama", "trump"]
        # Filter based on user screen name. Add here the screen names that you want to filter
        # the screen name is the @User name without the @
        users: ["BotSpotterBot"]
    #Plugins to sort tweets
    sort:
      # Give priority to posts that contain some words
      by_keywords:
        # If this sorting method is enabled
        enabled: true
        # Keywords to search
        keywords: ["ps4", "pc"]
      # Give priority to newer posts
      by_age:
        # If this sorting method is enabled
        enabled: true
      # Give priority to posts with more retweets
      by_retweets_count:
        # If this sorting method is enabled
        enabled: true


  # Actions that some giveaways require to enter
  actions:
    # Follow the user that posts the giveaway
    follow:
      # If this action is enabled
      enabled: true
      # Keywords to search in post for follow action
      keywords: ["follow", "follower"]
      # When max_following is reached, will unfollow oldest follows
      max_following: 1950
      # Follow multiple accounts from a single post
      # Experimental feature, please open issue with example post id if unusual behavior is observed
      multiple: false
    # Favorite the post
    favorite:
      # If this action is enabled
      enabled: true
      # Keywords to search in post for favorite action
      keywords: ["fav", "favorite", "like"]
    #This action allows to tag friends when requested
    tag_friend:
      # If this action is enabled
      enabled: false
      # Friends usernames to tag. Bot will randomly pick the required number
      # Usually maximum number of required tags is 3, so better define here 3 or more
      friends: ["friend1", "friend2", "friend3"]
      # keywords of tag to serach in post
      tag_keywords: ["tag"]
      # keywords of friend to search in post
      friend_keywords: ["friend", "friends"]
      # keywords of numbers to search in post
      number_keywords:
        1: ["one", "1", "a", "your"]
        2: ["two", "2"]
        3: ["three", "3"]
        4: ["four", "4"]

  # Intervals of bot tasks
  scheduler:
    # How often will search for new posts
    search_interval: 5400
    # How often will retweet
    retweet_interval: 600
    # A random margin from retweet interval to avoid bot detection
    retweet_random_margin: 60
    # Update blocked users list so posts of them are not retweeted
    blocked_users_update_interval: 300
    # How often will delete oldest posts in queue
    clear_queue_interval: 60
    # How often will update the remaining api rate limits
    rate_limit_update_interval: 60
    # How often will check for new mentions
    check_mentions_interval: 600

# Notifiers will notify when somenone mentions the user.(Possible win)
notifiers:
  # Pushbullet notifier
  pushbullet:
    # If the notifier is enabled
    enabled: false
    # Pushbullet api token
    token: my_pushbullet_token
  # Email notifier
  mail:
    # If the notifier is enabled
    enabled: false
    # Email provider smpt server
    host: smtp.provider.com
    # Port
    port: 25
    # Use tls
    tls: false
    # Email username
    username: sender_address@provider.com
    # Email password
    password: my_secure_password
    # Notification recipient
    recipient: sender_address@provider.com

Config file is loaded automatically from specific paths. The paths that are searched for config.yaml are (from highest priority to lowest):

  1. ./config.yaml
    Search for config in the current working directory
  2. ~/.config/Yatcobot/config.yaml
    Search in config folder. If for example your username is user the full path will be /home/user/.config/Yatcobot/config.yaml
  3. default
    The default config that is packaged with the bot.

Also you can define another config with the –config argument, which will have the highest priority

Higher priority configs override settings that are defined in the lower. So in your config you only need to define the changes.


Global

consumer_key, consumer_secret, access_token_key, access_token_secret

The twitter api keys that are needed for interacting with the twitter api. Obtain them from here


Actions

Here are defined all the action settings. Actions are requests that contests have, like follow and fovorite

follow

enabled

If the follow action is enabled

keywords

These keywords are searched inside the tweet’s text to determinate if it is needed to follow the original poster.

max_following

After this number of following users is reached, will start to unfollow the oldest follows

multiple

When this option is enabled, all users that are mentioned in the post will be followed

Warning: this is an experimental feature. Please open issue with example post id if unusual behavior is observed

favorite

enabled

If the favorite action is enabled

keywords

These keywords are searched inside the tweet’s text to determinate if it is needed to favorite the original post.

tag_friend

enabled

If the tag friend action is enabled

friends

The usernames of friends that will be tagged. A random username from this list is selected every time, so the more you add the better. At least 3 are recomended (giveaways dont ask more than 3 tags usually)

tag_keywords

Keywords for searching ‘tag’ in post. Useful for international posts

friend_keywords:

keywords for searching ‘friend’ in post. Useful for international posts

number_keywords

keywords for mapping words to number for identifying how many friends to tag. Useful for international posts


Scheduler

Intervals of bot tasks

search_interval

How often will search for new tweets from twitter. (seconds)

retweet_interval

How often a retweet will be posted. (seconds)

retweet_random_margin

Adds randomness to the post interval. For example if retweet_interval is 600 and retweet_random_margin is 60, retweets will be posted every 9-11 minutes. (seconds)

blocked_users_update_interval

The interval to update the twitter blocked users so you dont retweet posts from unwanted users. (seconds)

clear_queue_interval

How often the queue will be checked so if the number is over max_queue, delete some posts. (seconds)

rate_limit_update_interval

How often will update for the remaining api calls

check_mentions_interval

How often we check if the user is mentioned in a tweet. We check this because many contests mention the winners in a tweet, so we can notify the user for a possible win.


Notifiers

Notifiers are used to notify user when someone mentions him. This usualy implies that the user won something.

pushbullet

Use push bullet for sending notifications to pc or phone

enabled

if this notifier is enabled

token

the pushbullet api token

mail Mail notifications !

enabled

if this notifier is enabled

host

the hostname of the smtp server

port

port of the smtp server

tls

enable tsl encryption

username

username to login to the smtp server

password

password for login

recipient

email address of the notification recipient