mattstauffer / suggestive

Suggestive - take suggestions from the fans/followers of your podcast or blog
MIT License
98 stars 26 forks source link

Poll Twitter for tweets made containing a given hashtag #12

Open michaeldyrynda opened 8 years ago

michaeldyrynda commented 8 years ago

Addresses #5.

For any found tweets, add them as a new unflagged topic against the owner user record, so that they can be reviewed.

I've done some preliminary work on this and opened a PR so I can get some feedback on the direction I've taken so far. The basic theory is that a user will specify a hashtag that Suggestive looks for periodicially (scheduling the suggestive:poll-twitter command), and creates unflagged Topic records for the owner to review.

I assume as well that the /topics API endpoint should return only accepted topics (it currently returns everything).

I haven't yet made any interface to set a hashtag, though that's only because there's no user profile at this stage.

This will also use the application Twitter credentials, which is 150 requests every ~15 minutes. This may be ok initially, but it is trivial to make it 150 requests per user - you just need to capture the Twitter token and secret when the user signs up. Of course, that's not much good with a GitHub authenticated user, so you might want to lock it down to just Twitter users.

mattstauffer commented 8 years ago

Quick note:

I assume as well that the /topics API endpoint should return only accepted topics (it currently returns everything).

Nope. https://github.com/mattstauffer/suggestive/blob/master/tests/AdminTopicTest.php#L74 You can pass in parameters; haven't finalized what they'll be but right now it would be api/topics?status=accepted

michaeldyrynda commented 8 years ago

I saw that part. I meant to say that the topics list currently shows topics whether they're flagged as accepted or not.

The dashboard currently hits /topics without any query parameters.

mattstauffer commented 8 years ago

@deringer Aha, got it :) :+1:

will review PR later, busy day w the fam today :)

mattstauffer commented 8 years ago

Looks good. Architecturally, I wonder if it wouldn't be better to have something of a "machine" user that could be the one that gets assigned these topics?

michaeldyrynda commented 8 years ago

Some kind of system user was my first thought, but I don't know what the multi-tenant vision is for Suggestive, so wasn't sure how a polled status would then be assigned back to the appropriate owner. Happy to discuss and implement!

mattstauffer commented 8 years ago

@deringer I OWE YOU A PR REVIEW OF THIS. I still remember!

michaeldyrynda commented 8 years ago

In your own time my friend, though I’ll need to leverage some of the code I wrote here on another project at some point so another set of eyes over it will be handy (no rush!)

Michael Dyrynda

Sent from https://polymail.io/

On Wed, 02 Mar 2016 at 3:12 PM Matt Stauffer

< mailto:Matt Stauffer notifications@github.com

wrote:

https://github.com/deringer I OWE YOU A PR REVIEW OF THIS. I still remember!

Reply to this email directly or https://github.com/mattstauffer/suggestive/pull/12#issuecomment-191057749 .

https://github.com/mattstauffer/suggestive/pull/12#issuecomment-191057749

mattstauffer commented 7 years ago

@michaeldyrynda holy crap i never reviewed this :/ // / / / /// // // // /

michaeldyrynda commented 7 years ago

I did look at this yesterday. Now there are lots merge conflicts with compiled assets lol