Twitter GET statuses/mentions not returning anything - api

I'm trying to get a user's mentions using the Twitter REST API, but I'm not getting any response when I call.
I'm basically just trying to hit the URL they specify in the link I provided. I'm trying to get mentions by a specific user.
Here are the URLs I've tried, and none of them work (they all return blank pages):
https://api.twitter.com/1/statuses/mentions.json
https://api.twitter.com/1/statuses/mentions.json?screen_name=ludjanio
https://api.twitter.com/1/statuses/mentions.json?screen_name=ludjanio&include_entities=true

This API end-point requires authorization through OAuth. Besides all that, this API end-point doesn't accept the parameter screen_name. Full documentation of this API end point can be found here, https://dev.twitter.com/docs/api/1/get/statuses/mentions
If you want to get the mentions of an entirely different person, there is no direct API for this. But you can do a search for #, this is how most apps do this.

Related

LinkedIn API Changes

Our LinkedIn API calls started failing. Even the simplest /v1/prople/~ calls started erroring with This resource is no longer available under v1 APIs.
So we're trying to migrate stuff using the new /v2 way, but somehow it seems not to be working. For example (and after requesting a token with the new scopes), a simple request to /v2/me fails to return the fields we need (amongst others, headline and location). When asking explicitly for these fields, we're told that we don't have access to them - even tho the token was generated using the r_basicprofile r_liteprofile r_emailaddress scopes.
We've tried numerous combinations and variations of asking for certain fields, projections, formats, etc from the Microsoft docs - with no avail and we're wondering whether the /v2 API is actually something functional - is there anyone successful using it, and if so, how?
A sample CURL request with an obfuscated Bearer would be a good way for us to understand what we're doing wrong - but it seems that even the simplest requests verbatim from the docs just fail.
EDIT: After some research, it looks like Microsoft changed their versioned API behavior without being consistent in the docs. Some docs point to r_liteprofile and some others to r_basicprofile as the default way to go now without being "Linkedin Partners". We were previously requesting r_emailaddress too and the headline and location parts of the r_basicprofile bits were used in our code in many different places.
These were two problems:
Some of the fields are removed from v1 (headline, email, location etc),
Most of the fields requested are not available in v2 without special scopes, but these scopes are very poorly documented as being part of a "LinkedIn Partner" program our app has to be accepted in before we can now use them.
The basic answer to this question is that LinkedIn (Microsoft) made backward-incompatible changes to their API.

Official way to fetch the number of tweets for a URL

Twitter has private endpoints like this one:
http://urls.api.twitter.com/1/urls/count.json
Tweet counts can be fetched from here, but this is not recommended by Twitter. Besides, they keep saying they gonna shut down these endpoints in the near future.
The Site Streams API is now in closed beta, they don't accept applications.
https://dev.twitter.com/streaming/sitestreams
So that leaves is with only one option, the REST API, but I don't see any endpoint there which could return the number of tweets for a given URL.
What's the best way to get this data? Is there an "official" endpoint for this?
Or the only way is to use something like the Public stream API or the REST API search endpoints and filter the results?
The private endpoint will be shut down by 20 Nov and there'll be nothing to replace it. This blog post from Twitter explains the background: apparently it's to do with their move to their new "real-time, multi-tenant distributed database" system codenamed Manhattan.
The REST API will be of limited use for this purpose. You'd have to do a search for your URL, collect each page of results and add up the total number of tweets yourself. For example this request
https://api.twitter.com/1.1/search/tweets.json?q=metro.co.uk&count=100
will get tweets associated with http://metro.co.uk. (It won't work if you just paste this into your browser - you have to authenticate first. You can try this on the Twitter API console tool.) But the Search API returns a max of 100 tweets per page of results, and it only returns tweets from the last 7 days.
It seems the only solution (explained here) is an elaborate one using a Twitter Streaming API. Basically you'd have to create your own app to count relevant tweets. It would open a connection to stream.twitter.com passing your URL as a track parameter. Twitter will return a tweet every time anyone tweets the address, and your app will have to count them. The example given in that post is:
curl -u user:password "https://stream.twitter.com/1/statuses/filter.json" -d "track=https%3A%2F%2Fdev.twitter.com%2Fdiscussions%2F5653"
I'm not sure how you would deal with shortened URLs in this scenario.
This change has meant that third-party services like SharedCount that report a count of Twitter shares are having to stop offering that data. Sorry to give you bad news - I'm really disappointed with this situation myself. It seems crazy that we can't just get a total of tweets for a given URL.
You can find a little bit more about this in this thread.

Add a header to a page request using GET?

I have a vb.NET App that uses System.Net.WebClient to query an API. I'm able to get the information I'm requesting just fine.
The people that supply the API are requesting that I
"set a custom User header when requesting data to determine the source application."
Am I supposed to pre-send something first, or append something to the url for the WebClient to processes? The API only accepts get requests and it doesn't have a parameter for an identification.
I'm stuck in terminology here. A search for that phrase, here, came up with server-side topics so I don't know what to look for. Can someone translate?

Tumblr Follow Api

I am trying to to add a custom Tumblr follow button to my site and I've been trying to figure out how the follow api works.
I've been using https://apigee.com/console/tumblr to test various requests and so for I can make the get requests work, but not the post requests. Specifically, I would like to be able to follow a blog.
For instance, if i want to follow mcupdate The post request should look like this
http://api.tumblr.com/v2/user/follow?url=http%3A%2F%2Fmcupdate.tumblr.com
This returns 404 page not found. As do any and all variations that I can think of. Since the get requests work fine, I am assuming that the credentials that apigee.com generates are fine. Does anyone know what is the problem?
Thanks.

Github API - trying to access multiple pages of /users

I am playing around with Github's API and I noticed that they allow anyone to request all users that have signed up in chronological order.
https://api.github.com/users
http://developer.github.com/v3/users/
I was trying to get the second page but for some reason their pagination isn't working for me. I wasn't sure what I was doing wrong.
https://api.github.com/users?page=2
https://api.github.com/users?start_page=2
http://developer.github.com/v3/ Under "Pagination".
Anyone know the right way to do this?
Check out the returned HTTP headers for the https://api.github.com/users resource. Specifically, look for the Link header, which will look like this:
Link:<https://api.github.com/users?since=135>; rel="next", <https://api.github.com/users{?since}>; rel="first"
So, what you need to do is do an HTTP GET on https://api.github.com/users?since=135 to get the next page. After that, check the Link header again and you will get to the next page, etc. Also notice the provided URI template https://api.github.com/users{?since} which enables you to start at any id.