huginn/huginn

Reddit Agent

amacgregor opened this issue · 11 comments

I have some code from a similar project that can be adapted to create a Reddit Agent

Hey @amacgregor, that'd be very cool.

@amacgregor Was this still something you had laying around/wanted to contribute?

Added to agent suggestions list in #353

I was thinking about taking a stab at this reddit agent. I've been using the website scraper to grab all posts on the new section of a subreddit and parse the json using a trigger agent.

The website agent already has most of the functionality we would need for an iteration 0 of grabbing from reddit. Some things I would want to see built-in:

  • Grabbing posts from hot/new/rising/controversial views of a sub-reddit
  • option to choose ssl or not (http vs https)
  • Following a particular user's posts

The functionality above deals with just scraping pages anonymously. I can imagine having the ability to log-in to your account, and perform actions as well. Thoughts?

Hey @mcgriddle. Welcome!

I could see two approaches:

  1. you might be able to achieve most of the above using Huginn itself, with a set of WebsiteAgents and triggers. (You might need to add a few small missing features to Huginn as well.)

  2. You could make a dedicated RedditAgent that did portions of the above in pure Ruby.

So I started to write some code around a reddit agent, but the more I dug into it the more opinionated I realized the agent would have to be. I prefer just to use the existing agents: Website -> Deduplication -> Trigger -> Formatter -> Pushbullet

You could put those in a Scenario and then export and share it.

Hey guys. I've started on this as my first agent, it's in a very rough, but functional state:
https://github.com/kholbekj/huginn/blob/reddit_agent/app/models/agents/reddit_agent.rb

It currently serves my intended purposes, but I'd love some feedback to refine it and create a PR <3

Hey @kholbekj, welcome! This might be a good candidate for pulling into a gem using https://github.com/cantino/huginn_agent. You're also welcome to make a preliminary PR to Huginn with this and we can give some feedback.

Okay, I'll start with the PR then, and look into extraction at some point!

Any word on when this will be added?