2017 © Pedro Peláez
 

project reddit-bot-app

Reddit.com bot for Symfony2

image

isometriks/reddit-bot-app

Reddit.com bot for Symfony2

  • Sunday, May 4, 2014
  • by isometriks
  • Repository
  • 1 Watchers
  • 1 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

/r/symfony Bot

Install with:, (*1)

php composer.phar create-project isometriks/reddit-bot-app -s dev

Right now it's really only useful for RSS feeds, here's the configuration:, (*2)

# Reddit Wrapper Config
isometriks_reddit:
    user: %bot_user%
    password: %bot_password%

# Bot RSS Config
isometriks_reddit_bot:
    feeds:
        symfony2_blog:
            url: http://feeds.feedburner.com/symfony/blog
            subreddit: symfony
            flair:
                - news
            options:
                link: publicId
        symfony2_community:
            url: http://feeds.feedburner.com/symfony/planet?format=xml
            subreddit: symfony
            flair:
                - community
            options:
                link: publicId

The %bot_user% and %bot_password% will come from paramenters.yml and are set in parameters.yml.dist if you use composer. You can use a cron job to make the command run every hour by default or send an argument after:, (*3)

0 * * * * php /home/symfonybot/app/console reddit:bot:rss

You can send arguments after to tell the bot how long to check:, (*4)

php app/console reddit:bot:rss 5 hours ago

*Please note that you cannot use something like "-5 hours" as a command. The Symfony command component tries to recognize it as a flag. We're using an input as an array and then imploding on a space " " to turn it into a string., (*5)

TODO

  • Add Flair after post is submitted

The Versions