johnbuluba / Yatcobot

Yatcobot (Yet another twitter contest bot) is the most advanced and configurable bot for twitter contests and giveaways
GNU General Public License v2.0
63 stars 5 forks source link

I NEED YOUR OPINION FOR NEW CONFIG!!! #15

Closed johnbuluba closed 6 years ago

johnbuluba commented 6 years ago

So, in the last few days i changed the format of the config file, using yaml. The reason behind that is that some features that was requested need more settings and the json was already pretty messy.

Currently the new format is like


# 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

  # 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
  # Keywords that if they appear in a post it will get
  # priority for retweet
  priority_keywords: ["pc", "iphone"]

# 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
  # Favorite the post
  favorite:
    # If this action is enabled
    enabled: true
    # Keywords to search in post for favorite action
    keywords: ["fav", "favorite"]

# 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

Also please check the new documentation https://yatcobot.readthedocs.io/en/dev/index.html

Any insight or opinion is welcome, before i merge it to master and becomes pretty much permanent

bruvv commented 6 years ago

I never seen yawl, json makes more sense for me.

    - Giveaway retweet:
      lang:en

Why is there a : after retweet? Is that because of the lang or is that included in the search?

johnbuluba commented 6 years ago

@nivong In yaml when a line starts with - is a sequence and when it contains : its a mapping. The python analogies would be - for list and : for dictionary.

I selected this format so the user have more control over each query, adding option on per query base. So in this example the query is "Giveaway retweet" with an option lang=en

In the future it could be expanded with more options like this:

search:
  queries:
    - query without option
    - query with language option:
      lang: en
    - query with age option:
      max_age: 10
    - query with both options:
      lang:en
      max_age:20
    - query without option again
bruvv commented 6 years ago

Omg that is amazing! yes that will be fantastic