Pocket API: How to get tags list - api

I found that the Retrieving API has a tag parameter which is used to get items tagged with tag_name.
But I do not know how to get the tags list. If the tags list cannot be got, then how to set this parameter to get special items with this tag.

I have been examining this issue very thoroughly for the past weeks (a request for tag list functionality from a user of my Window 8.1 app Pockazine), and my research confirms that fcedillo is right in saying that the API does not seem to support such a simple request.
However, both the Android app, the iPad app and the webapp (and the mentioned getTags.php) does provide a list of tags which leads me to believe there is a non-official API to get this information. How else would the native Pocket apps be able to get this information - I do not believe it is downloading a full list of all articles.
Even if this functionality is not implemented in the API yet, it really should be a simple database query like "select distinct(tag_name) from ... where user_id = ..." with a webservice layer to wrap it with a few parameters.
I have raised the issue with Pocket and followed up with emails to Pocket for the past few weeks without any luck.
My own workaround is to get all active and archived items with the "detailType" parameter set to "complete" and then iterate over the entire list and collect tags from the tag list in each article.
That is a cumbersome and expensive operations both in terms of time (20 seconds for 6.000 articles downloaded in packages of 2,500), data packages (at least 12 MB for that list of 6.000 articles) and database cpu-time (probably not that much, but still worth mentioning).
Even this is not a satisfactory solution since it seems I can maximum download 6,000 articles (unless I myself have precisely that amount of active and archived articles) - and even if I could it would be a bad idea to e.g. download 100,000 articles just to show maybe 50 tags or so.
So ... If anybody has a different solution (or I get an answer from Pocket) then I would be extremely glad for a followup to this post.

I think that Tag list cannot be got using the API
If you just want the list, you can take it from getpocket.com, browse to your list
And look for response to getTags.php request
https://www.evernote.com/shard/s187/sh/7d0fb324-379c-466f-a695-fc2184576ad6/5b23f3bb0165d9c7
You will find an array of tags:
eg. ["tag1","tag2","tag3"]
Maybe this could be helpful https://github.com/HartasCuerdas/ruPocket
That is an implementation to work with Tags from Pocket, its written in Ruby

I contacted api#getpocket.com and they gave the same answer - no API to just get the tags list.
I forgot to set a detail type, which is why I wasn't getting the tag information on an individual article.
Call https://getpocket.com/v3/get with the 'detailType' POST parameter set to 'complete' (as someone already mentioned earlier in a longer answer)
Then you get the tags back
....
"has_video": "0",
"has_image": "1",
"word_count": "513",
"tags": {
"entrepreneur": {
"item_id": "1768258176",
"tag": "entrepreneur"
},
"work": {
"item_id": "1768258176",
"tag": "work"
}
},
....

Related

Inaccurate Security Graph API Responses

For some odd reason the results that I am getting from the Graph Security API the past two days are inaccurate and I can't for the life of me figure out why.
If I query https://graph.microsoft.com/v1.0/security/alerts I am returned 7 old alerts without any obvious relationship, rhyme, or reason for populating my results. These are not the 7 most recent, and we have had more than 7 alerts.
For example, when attempting to append $filter=vendorInformation/provider eq 'Microsoft Defender ATP' I receive:
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#Security/alerts",
"value": []
}
This issue appears to extend for me across all of the MTP services.
I can see the alerts within MDATP, and others like MCAS and ASC for example when navigating directly to those portals or querying their platform specific api's, like
https://api-us.securitycenter.windows.com/api/alerts for example.
I am getting data returned, it is just not the right data.
I am utilizing a Postman App registration with the SecurityEvents.Read.All and SecurityEvents.ReadWrite.All "Granted for MYDOMAIN".
I feel like I am missing something here. Any one else having issues? More than happy to share additional details that would be useful.
Thank you for your feedback. Our MDATP team has identified and fixed the issue and it should now work as expected.

Twitter API Standard Search: Can I get hidden replies?

I am trying to get as much data as a I can out of the Twitter API for an academic research project. Even though I only have access to the Standard API the data should be as accurate as possible. I am building myself a "wrapper" around Twarc and other utilities in Python that gets me most of the data I want in just the format I need. A big problem was getting all the replies, but I was able to solve it with a bit of trickery: Searching from the tweet in question onwards and then checking if the tweets in the obtained sample have the original tweet ID in "in_reply_to_tweet_id". Rinse and repeat with those newly obtained tweets.
Then I noticed the new moderation feature Twitter implemented in March. Now the moderated comments under "More replies" do not show up in my search output.
Example: https://twitter.com/NDRreporter/status/1113353224730365952
I find all replies except the following: Under "More replies" ("Mehr Antworten" in German), there is a reply chain started by a extreme right leaning (possibly troll) account ("#Der Steuerzahler") that got moderated and shoved down there. This does not show up in API searches, even if I let the code iterate for over an hour just looking for replies to this particular original tweet.
My question is pretty general: Aside from getting replies as they come in (i.e. before they are moderated) via Filter API, is it possible to find these moderated tweets via the Standard Search API? Not looking for a ready-made solution, general pointers suffice. If I can't find them via Search, then I obviously won't try it with that anymore.
Thanks in advance.

Change in number of geotagged Instagram posts

I have written an app which uses the Instagram API to retrieve geotagged posts containing "#sunset" and related tags. On March 22 - 23 2016, the number of posts being collected dropped dramatically. Has anyone else observed this behavior, or do you have any suggestions for what I should look for? Is it possible there has been a change to Instagram's privacy policy that leads to fewer geotagged posts? I do not think it is due to a change in my code (I have not changed the code, and I am actually collecting the posts using two different methods, both of which display this pattern). Nor do I think it is due to my API key suddenly becoming invalid (the key seems to work).
UPDATE: I discovered other people have been having similar problems. See here:
Instagram API /tags/{tag-name}/media/recent changed behaviour
Instagram /v1/tags/{tag-name}/media/recent endpoint doesn't return min_tag_id in pagination block
UPDATE 2: it appears that both the Python + Ruby Instagram clients were deprecated on the same day, March 22, right before everyone started having this problem: https://github.com/facebookarchive/instagram-ruby-gem/commits/master, https://github.com/facebookarchive/python-instagram/commits/master

Instagram realtime get post from callback

Right, this is really working on my nerves, but Instagram has to do something about their bloody documentation.
I am already trying for a week to live update my website with new instagram posts without refreshing the page. Twitter was fairly easy, but instagram is just one big mess. Basically I use the realtime Instagram API, the callback and all that stuff is working fine, but thanks to Instagram it does not return me an ID from the post that is new, the callback only returns some basic stuff:
[{"changed_aspect": "media", "object": "tag", "object_id": "nofilter", "time": 1391091743, "subscription_id": xxxxx, "data": {}}]
with this data you are nothing, except for the Tag, but I knew the tag before this callback too so doesn't matter. It actually only tells me that there is a new post. I have tried doing the same request as when the page loads, when this callback occurs, and get the posts that are newer than those already on the page. Unfortunately I have not succeeded in this yet. I have picked the ID from the last posted instagram post, and checked if it is in the callback request, and it's not.
What am I doing wrong?
I'd appreciate some help, thanks!
Edit:
I'd like to note that this is not only a problem with the realtime api, but also with the normal API. I just don't know how to compare data so I don't get duplicates in my database(normal api), or on my website (realtime). I can't find any tutorial or documentation (Yes, I might be blind), that explains to me how to compare data. I can only find the min_id and max_id, but no explanation what these id's contains. I checked these id's with id's from results, and they do not match. It's not an ID from a media item.
I also checked the next_url, and in my logic thinking, this should be a URL to the next page (like Twitter).
Am I looking at this all wrong?
Ok strike my old answer, I changed the way I do this. Here's how I'll do it now.
I still wait for 10 hits on my Real-time subscription, when I reach 10 I send off a new thread (if one is not already running).
The sync thread queries my DB for a value, I need the last min_tag_id I used. Then I query:
https://api.instagram.com/v1/tags/*/media/recent?access_token=*&min_tag_id=*
Try it out here: https://api.instagram.com/v1/tags/montreal/media/recent?access_token=*
You'll get 20 results, and a min_tag_id value. Append that to your url, you'll see you get no results. Wait a couple of seconds and refresh. Eventually you'll get some media, and a new min_tag_id.
(You can ignore the "next_url" value they give you, you won't be using that).
Basically you only need to store that min_tag_id and query until you have no more results, that means you're done then.
When you get a subscription push, you need to query that endpoint (tag / recent).
I normally start an synchronous thread to perform this so I can answer in under 2 seconds to Instagram.
Then you parse that endpoint and look for a "next url" value.
Keep querying that end point, parsing the media and going to the next url until you find your stop condition.
For me I try to match 10 consecutive records in my DB. Basically from the tag, I store media when then meet my business rules.
The Instagram documentation is accurate and actually well written.
The realtime API is working correctly. As stated in the documentation:
The changed data is not included in the payload, so it is up to you
how you'd like to fetch the new data. For example, you may decide only
to fetch new data for specific users, or after a certain number of
photos have been posted.
http://instagram.com/developer/realtime/
You only receive a notification that an update has happened to your subscribed object. It is up to you to call the API to find out what that data is.
You can call the /tags/[tag-name]/media/recent with an access token that you have previously stored on your own server or DB. Then, you should be able to compare the data returned from that endpoint with any data you have retrieved prior, and just pull the objects that you do not yet have.

Is it possible to retrieve arbitrary number of items from reddit using API?

I am writing a small assistant app to read (well, filter/rank) /r/programming/ for me, because it has so many damn posts, and because certain area of my coding skills was getting rusty and it sounds like good exercise.
I am getting items from "new" page of the subreddit using json api; however it only returns 25 items per request (which is the page size), so to retrieve items for, say, last week, I need to make dozens of requests. As the mandated request interval is 2s, it is painful.
I wonder if there's some way to retrieve more items? Query string parameters for standard html gets also work for json gets, but I cannot find one for page size.
EDIT: for posterity, the paramrter name is "limit", although that too is capped at 100
for posterity, the parameter name is "limit", although that too is capped at 100