Flattr API gives File Not found Error - flattr

I try the following example: https://api.flattr.com/rest/v2/things?id=38589
The ID Exist but I get a File Not found Error.
Something wrong in the API? I know it worked a couple of days ago.

The correct URL to thing with id 38589 is https://api.flattr.com/rest/v2/things/38589
And to get multiple things you separate them with a comma:
https://api.flattr.com/rest/v2/things/38589,123
I spotted a error in the documentation concerning fetching multiple things and will update it at once.

Related

Shopify orders api returns invalid data

I'm currently making a request to shopify api like so:
I've tried hitting these end points:
orders.json?updated_at_min=2019-07-17T19:00:42-07:00&limit=150
orders.json?created_at_min=2019-07-17T19:00:42-07:00&limit=150
orders.json?updated_at_min=2019-07-17T19:00:42
According to the docs found here:
https://help.shopify.com/en/api/reference/orders/order
this is a valid end point call:
created_at_min
created_at_max
updated_at_max
The results I get back are:
+"closed_at": null
+"created_at": "2019-08-07T19:02:37-07:00"
+"updated_at": "2019-08-07T19:02:52-07:00"
The above is just part of the returned data. What gives? The created_at_min doesn't work neither does updated_at_min
The docs say the string should be: Iso8601String
This was a bug that Shopify just posted that they've fixed:
https://community.shopify.com/c/Shopify-APIs-SDKs/Orders-gt-created-at-min-ignored/m-p/553667/highlight/true#M36625

Create direct url to LinkedIn company update

I'm implementing a Compony newsfeed on a website and ran into the following problem. The LinkedIn API doesn't provide a direct URL to a company update. Looking at the LinkedIn site there are direct URL's and they're like this for example:
https://www.linkedin.com/company/1441/comments?topic=5849556347070205952&type=U&scope=1441&stype=C&a=5uHW&goback=%2Ebzo_*1_*1_*1_*1_*1_*1_*1_1441
Trying stuff out it seems that the parameters topic, type, scope, stype and a are mandatory for the URL to work.. (goback is the only one that isn't).
Using the LinkedIn API with the Company updates call I'm able to buid the direct url, except for the a parameter. The value is always 4 (for me unexplainable) characters long.
Has anyone ever successfully build a direct URL to a company update or can someone maybe explain the a parameter or how to generate its value?
Updated to new format
You can link directly to any update (company or user) using the following url:
https://www.linkedin.com/feed/update/urn:li:activity:[topic_id]
You can get [topic_id] by getting the last bit of the updateKey in the api response from Linkedin. When updateKey = UPDATE-c7352-6410848097894756353, your topic_id = 6410848097894756353.
In your example that would become https://www.linkedin.com/feed/update/urn:li:activity:5849556347070205952 which links directly to the specific update. The post is too old to work with the new link format
The url used to be
https://www.linkedin.com/nhome/updates/?topic=[topic_id]
Updated thanks to the comment from #sethpollack
For anyone trying to get the topic id from the API response object (as already commented on the OP question), the topic id is the value after the last hyphen of the updateKey property, which can be used with #Daan answer:
"updateKey": "UPDATE-cXXXX-YYYYYYYYYYYYYYYYYY"
Direct URL:
https://www.linkedin.com/nhome/updates?topic=[YYYYYYYYYYYYYYYYYY]
Using the URL format above, get the topic_id by opening the update in its own window/tab, look at the page source code in your browser and search for the string :activity: the long number after the string is the infamous topic_id

Disqus API: get total forum number of comments/posts

I'm trying to get the total number of comments that have been written in a given forum.
Looking at http://disqus.com/api/docs/ I can't see anything like this. Honestly, it sounds weird.
Forum details ( http://disqus.com/api/docs/forums/details/ ) shows anything but.
Any hack/piece of code/hidden API call that would to the trick?
Thanks in advance
The best way I have found is to get the list of all the threads and then sum the number of posts for each one:
curl -0 -L "https://disqus.com/api/3.0/forums/listThreads.json?api_key=YOUR_API_KEY&forum=YOUR_FORUM_NAME&limit=100"
Dont forget to iterate over different pages of results if you get a 'next' cursor (response['cursor']['next']).
See this gist for a full JavaScript example (intended to run on Google Script):
https://gist.github.com/sarfata/5068200

google analytics API, how to extract pageviews for a specific page?

Google Analytics API: how to extract pageviews for a specific page?
I tried using something like
ga:pagePath=~page.php%3fid%3d44 (page.php?id=44)
but it doesn't seem to work... I get "no results found" where I have 20 pageviews for sure
UPDATE
I think I found the solution
ga:pagePath==/website/page.php?id=44
for some reason I had to include the complete path and ==
To use a partial path to match for a page in filters you should use
ga:pagePath=#page.php?id=44
=# tells ga to match a substring.
What you were originally using was incorrect for this.
I think your problem is that you put the hex version of the ? and = characters into your query, which doesn't match how Analytics stores the page paths. If you change these to the normal characters it should work:
ga:pagePath=~page.php?id=44
Your other solution should work as well but is a bit more inflexible in case you wanted to tweak the query to return other pages.

Google Custom Search API, Howto return country specific results only

I am making some PHP code which takes a given search phrase and url and searches through the google search results until it finds the url (only first 100 results). My problem is, this is only working for the US. I have tried adding the "&cr=" option, but it still on returns US results.
The full URL I am using for the request is:
https://www.googleapis.com/customsearch/v1?key=API_KEY&cx=CX_VALUE&q=KEYWORD&cr=COUNTRY&alt=JSON
Does anyone have any experience with this? I want to be able to see UK results. Tried inserting &cr=countryUK , but still only does US results.
Thanks :)
Regards,
Stian
Use the gl=<country code> param to limit it to your country of choice (so gl=gb for the uk).
More info here:
http://googleajaxsearchapi.blogspot.com/2009/10/web-search-in-your-country.html