bridgy icon indicating copy to clipboard operation
bridgy copied to clipboard

batch Twitter searches

Open snarfed opened this issue 11 years ago • 9 comments

facebook and google+ both support batching API requests. facebook can even parameterize requests in the batch on the results of earlier requests in the same batch.

full polls for FB and G+ both take a fair number of requests, so this would definitely help.

https://developers.facebook.com/docs/reference/api/batch/ https://developers.google.com/api-client-library/python/guide/batch

snarfed avatar Jan 28 '14 04:01 snarfed

this will also help keep us under the 10k/day G+ API limit.

snarfed avatar Jan 31 '14 18:01 snarfed

deferring for now in favor of #13, which overlaps and will be better for cutting down effective API calls from the silos' perspective.

snarfed avatar Feb 18 '14 16:02 snarfed

did G+ in snarfed/activitystreams-unofficial@dcb651b154c9c109146b67de33e5e496933b9332

snarfed avatar Sep 07 '14 21:09 snarfed

interesting. i'm not sure this changed average G+ poll latency much, but it seems like it brought the tail (90%ile, etc) down. average went from ~2s to 1-2s, but 90%ile seemed to go from >10s to ~2.5s. so that's something at least.

https://console.developers.google.com/project/apps~brid-gy/appengine/logs?fromac=true&filters=path:%2F_ah%2Fqueue%2Fpoll&filters=regex:%2Fgoogleplus%2F

snarfed avatar Sep 08 '14 03:09 snarfed

i also wonder if i could batch some twitter API calls, indirectly, by combining the search queries i use to find @-replies. i currently make one search call per user, but i could probably batch them with the OR operator.

motivated by #280, twitter's search API hanging more often.

snarfed avatar Sep 08 '14 17:09 snarfed

we actually get facebook comments and likes for free, without extra API calls, so batching isn't as important for FB. we do make one extra call each to get photos and rsvps, and one call per (upcoming) event created by the user, but common case that's not much.

snarfed avatar Sep 14 '14 05:09 snarfed

as for twitter, it looks like the OR search operator would work. we'd still have to make multiple search calls, since we have to recurse to follow chains all the way, but it'd help. it'd take some work though, and i don't know how important it is. deprioritizing for now.

snarfed avatar Sep 14 '14 06:09 snarfed

i got halfway through porting Facebook.get_activities_response() in activitystreams-unofficial to the batch API, and it just wasn't working. it added too much complexity. we can revisit it later - i have it in a stash - but right now it just wasn't feeling worth the performance improvement.

snarfed avatar Jan 27 '15 07:01 snarfed

dropping FB from this since Facebook support is dead (#817, #826).

snarfed avatar Jun 05 '18 14:06 snarfed

Obsolete, Bridgy Twitter is dead.

snarfed avatar Apr 06 '23 21:04 snarfed