How can I get share count using the new Twitter Search APIs? - twitter

I wonder if it's still possible to use the Search API on client side using an AJAX call, C# would be fine too, but so far I'm finding a lot of talk about this but no code sample or any good instructions how this can be done,
Some sites like these are doing it but obviously this got way more complicated to do than before
I don't see any practice examples on https://dev.twitter.com/rest/public/search
Any suggestions?

As you've discovered, Twitter has turned off the sharecount API - see https://twittercommunity.com/t/a-new-design-for-tweet-and-follow-buttons/52791/5 and https://blog.twitter.com/developer/en_us/a/2015/hard-decisions-for-a-sustainable-platform.html
There are some alternatives like https://opensharecount.com/
That works by continually searching the Twitter API and counting up all the shares that it sees.

Related

What is a good strategy for staying up-to-date with external API's?

My project is reliant on several API's, like Twitter and Youtube for example. Recently, Youtube deprecated their old API, and it caused issues with my team's iPad app.
We could have stayed ahead of the change if we were paying attention to Youtube's announcements of the upcoming deprecation. But alas, we were not and the idea of staying up to date with all of our dependencies manually(browsing the web) seems exhausting and inefficient.
I have found the following tool to help notify when changes occur with external library dependencies, https://libraries.io. However, this does not help with API dependencies.
Besides checking the API source webpages every so often, I was wondering if anyone had suggestions on how to stay notified and up-to-date with news regarding updates to a specified list of external API's?
After some time looking at different options, I have found a solution that is not perfect, but seems to work best at fitting this need.
Solution Description
This solution uses a combination of Twitter, Google Scripts, and website blogtrottr.com. I am creating a twitter list of reliable dev handles that often post updates on new API. For example I made a list that contained #twitterapi and #YouTubeDev. Used Google Scripts to create an online feed out of the twitter list. Then used blogtrottr to email me every time that feed gets a new posting.
Steps to Implement
Create a twitter list of reliable handles that often post about updates to their API
Create an RSS Feed from that Twitter list. The details for how to do this can be found here.
Plug that url that you get from Google Script into blogtrotter.
I did find some other ways to do this, but so far this is the only solution that was 100% free!

Integrating Facebook,twitter,google plus into another app

Integrating facebook,twitter and google plus into another web app, so that the posts in that app are posted write away as status in facebook,tweets in twitter and status in google plus.I am developing this using ruby on rails.I searched a lot about this but didn't find anything which would work for me.Can post some links or ideas which would be helpful for this.
For Facebook I must suggest you to use Koala Gem...
For Twitter
Twitter
https://twitter.com/about/resources/buttons
A twitter button can be easily generated here and placed on your web site..Its working great. You can even customize everything in twitter.. Its so user friendly.
For Google plus
Google Plus
I am just working on Google plus..Facing some difficulties as its having so many restrictions.
Still I would Like to Share a link you can follow that..
How to share content from our site to google plus
I hope it will work fine...
I'd suggest to use Koala ( https://github.com/arsduo/koala/wiki ) to interface with Facebook. It's by far the best maintained fb library out there.
Otherwise, you should learn one thing or two about OAuth2:
https://github.com/intridea/oauth2
https://developers.facebook.com/docs/authentication/
https://developers.google.com/accounts/docs/OAuth2
Use https://github.com/sferik/twitter to interact with twitter.
For google, I've found that implementing the XML chat manually is easier than using any existing API wrapper. To convert XML responses into data, you an use a combination of the Response#parsed method of oauth2 gem and Array.wrap of ActiveSupport (there is no way for an XML parser to tell a single node to a possibly repeated node (so an array) that appears just once, avery big drawback of XML in my point of view)
Or you can directly ask google for JSON, so you already have the data correctly structured.
And, as #brendan-benson very correctly says, do only API calls in background workers, never in your normal request/responses cycle.
There are plenty of gems available to access these APIs:
Twitter API Wrapper
Facebook API Wrapper
Google Plus API Wrapper
Since APIs are flaky, it's best to use a queueing system like resque to queue the calls in Post#after_create, and then have a resque worker execute the call asynchronously.

Track multiple search terms with twitter streaming

I would like to build a web application that tracks some user defined search terms in real-time and provides a real-time visualization. http://www.monitter.com/ is an app I've found that is similar in its requirements. What is the appropriate API to use for it? Initially I thought the streaming API was the obvious choice, but the limitation of one concurrent connection means that I can only track one search term at a time(with one user account). I could get around this by making multiple user accounts, but that seems like the wrong approach.
I looked at user streams but the language for that API seems to be more geared towards desktop applications.
So, what is the most best API for my use case? Thanks.
Actually you can track up to 400 keywords/terms via one streaming API connection.
https://dev.twitter.com/docs/streaming-api/methods#track
Depending on language you are using there are multiple interfaces you can use.
If you are using PHP, then I can suggest Phirehose as it works quite well and has multiple examples for different usages scenarios included.
http://code.google.com/p/phirehose/wiki/Introduction
Whats not there - when processing received tweets you will need to figure out how to match which tweet corresponds to which keyword/term because twitter streaming API gives all matching tweets in one stream.
Investigating further using Firebug, I found that monitter.com simply polls the REST search api every second or so on the client side. This is what I ended up doing as well.

using APIs with oauth for single user

I'm trying to make use of various APIs including twitter, youtube, etc because we want to embed recent entries (tweets, videos) on our website.
However, since I'm just retrieving my own data, I'm wondering how I can do this simpler than the multi-step process required by OAuth.
Twitter provides me with my own access token I can use directly, so that kinda works, but I can't find any such token in the YouTube documentation.
So how am I supposed to make use of the api if I just want to get a simple list of stuff? how exaclty am I supposed to authenticate my own website to use my own account?
I think i might have things all wrong and if so please point me in the right direction. I tried using rss feeds but they don't give me as much control over what I retrieve as using the API directly...
any insight or suggestions are appreciated!
see my comment above. summary: it depends on the requirements of the individual api

Getting stats for Twitter app

I'm using Twitter's OAuth for my app (DroidIn)
To my dismay I can't find any way to track who and how often is using the app. Searching Twitter for "sent from DroidIn" does not yield any results. I suppose I can call some sort of counter app from my code but that doesn't seem to be fair to my users. Any ideas or suggestions?
It seems that yet again I have to answer my own question. After some investigation and feedback from question posted on Google Twitter developer group it seems that for now there are no stats easily accessible or available. Said that I found 2 interesting things:
You can search Twitter using source:yourapp switch. For example you can try this query
android source:API
There is very exciting streaming API from Twitter. I have a short write-up in my dev blog.
But if you want some actual stats there's no other choice today but implement it as part of your app. There's one more possibility if you have some sort of web-based interface you may want to use Google Analytics to trigger some Google javascript while submitting the update. I'm trying that right now and may end up with article in the blog

Resources