Skip to content
This repository was archived by the owner on Mar 30, 2022. It is now read-only.

Conversation

@michaeldyrynda
Copy link

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.

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

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
Copy link
Author

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
Copy link
Owner

@deringer Aha, got it :) 👍

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

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, we actually want to list out all proposed topics for the purpose of voting.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhh, my bad - I misunderstood the purpose of the accepted status.

@mattstauffer
Copy link
Owner

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?

Michael Dyrynda added 5 commits December 13, 2015 10:30
@michaeldyrynda
Copy link
Author

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!

Limit duplication of incoming topics by rejecting statuses which have been either quoted or retweeted.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opening parenthesis of a multi-line function call must be the last content on the line

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can inject?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh man, I commented on your comments above but GitHub has hidden them all now 😁

There's a couple of others where I asked for feedback on, too. Should have waited before pushing new commits. I'm not a GitHub noob >_>

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, no need to wait; usually it won't wipe the old comments. I'll look through them.

On this one, your comment was:

It's not an interface, it's an (I don't know what the proper name is) alias to the underlying return, given the TwitterOAuth client doesn't implement an interface.

Would you suggest that in this instance we would create an app-specific wrapper for it that implements an interface so that we can bind to it?

This particular solution has always seemed hacky to me (I use the same method in another app I have). The alternative would be to wrap it in a facade?

I'm not sure what you mean for the Interface; why don't you just typehint Abraham\TwitterOAuth\TwitterOAuth? If you want TwitterClient as a shortcut like you have it here, you can bind one of them like you are right now, and then have the other one alias to it. Ping me here if you want me to write out the code for what that would look like.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, for some reason I had trouble getting this to work in another project use used TwitterOAuth with, but that's because I was passing the additional parameters to it, so needed to use app()->make() to pass the extra parameters in.

I'll push an update shortly that fixes this and pushes the functionality off to a Job 👍

Michael Dyrynda added 2 commits December 13, 2015 17:42
Add a bit of logging around Twitter API rate limits so it's obvious if things "just stop working"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each class must be in a namespace of at least one level (a top-level vendor name)

@mattstauffer
Copy link
Owner

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

@michaeldyrynda
Copy link
Author

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
#12 (comment)
.

#12 (comment)

@mattstauffer
Copy link
Owner

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

@michaeldyrynda
Copy link
Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants