smart-facility / cognicity-reports-powertrack

cognicity-reports: NodeJS app - Twitter & GNIP PowerTrack support for the CogniCity framework
5 stars 4 forks source link

Set in_reply_to_status_id_str #1

Closed matthewberryman closed 9 years ago

matthewberryman commented 9 years ago

Please set this bit of metadata as per https://dev.twitter.com/rest/reference/post/statuses/update so that we can track which tweet a reply from @petajkt was from, for analysis & debugging purposes.

matthewberryman commented 9 years ago

Hi guys,

I wanted to test my change around the 'reply to' metadata, and realized there are a couple of concerns.

One is that we have only one Gnip account, and while it supports two streams I am concerned about interrupting the connection to the live server which may happen if more than one of us runs the app locally. Also when we launch an application we delete all the rules and push them again - while this is fine according to the Gnip documentation I don't want to impact on the production deployment and any local dev may do so if something goes wrong. Twitter sending is another issue; I'd really like to test the 'reply to' meta-data by seeing it work in a test environment but we only have credentials for the @petajkt account to post via the API, so I don't have any way to test this unless I use that account to post.

I guess as we're in beta we could do a controlled test of this from the production machine, where we update the code to include the 'reply to' meta-data update, start the app, and check the responses; letting us shut it down and fix things if it's not right. It's not ideal but it may be acceptable? Ideally I think we need to try and get a completely separate test environment so that our development and testing won't impact on production, but I realise that may not be practical.

Anyway, I've got the code for the 'reply-to' written but untested. One quirk was the Gnip activity stream data doesn't pass the tweet ID so we have to parse it ourselves out of a larger composite ID for which I haven't found clear documentation yet, I want to look in to this more but also I'd like to test this carefully when complete. Also I looked up the details on the coordinates, and Twitter sends two forms - one lat/long which as 'geo.coordinates' which is deprecated, and one long/lat as 'coordinates.coordinates' which is the recommended one. Gnip activity stream seems to only pass through the deprecated form so our cognicity-reports code is fine and works with twitter but we needed to use the other order for Gnip!

Regards, @benatwork99

matthewberryman commented 9 years ago

Hi,

From experience testing today this would be a nice feature.

You should be able to test this using your testing twitter account? Register for api keys etc at dev.twitter.com, and make sure you only send a handful of test tweets. This is how we originally started testing petajakarta before we got whitelisted.

I agree about PowerTrack, we're getting such good coverage at the moment I don't want to interrupt. Can you test the send message using sample/old data? I.e. from one of our accounts to another?

Thanks, @talltom

matthewberryman commented 9 years ago

@benatwork99: @talltom's suggestions for testing sound good.

@talltom Just to be clear on what that metadata does, here is a comment that Ilya made in reply to your tweet, with metadata in his tweet that refers back to your tweet, so you can see the thread as follows: screenshot 2014-11-19 09 04 56

Here's a tweet from the current harvester, without metadata, and you can see the absence of the the tweet it was in reply to—you'd have to manually go back on twitter or in our database and find it. screenshot 2014-11-19 09 06 57

benatwork99 commented 9 years ago

@matthewberryman @talltom

My twitter test account doesn't have posting ability, we need to associate a mobile phone number with it to post - I'll see if we can track one down which isn't already associated with a twitter account.

I can test with canned data instead of the live stream, it won't be 100% the same as a proper test but will give us more confidence that changes work.

benatwork99 commented 9 years ago

Committed and tested on beta harvester, all appears to be working fine.

Replies to retweets do not show as conversations but this is how twitter handles it when we (correctly) reply to the retweet not the original tweet.