What is the "uniques" value returned by GitHub's /repos/{owner}/{repo}/traffic/views REST API? - rest

GitHub provides a REST API to get the number of page views for a repo. Documented at https://docs.github.com/en/rest/metrics/traffic#get-page-views.
The call returns 'count' and 'uniques', but there doesn't appear to be any documentation defining what 'uniques' means.
Does anyone know what 'uniques' means? Is it the number of visitors for the day?
(I've not found any web discussion on this topic.)

Related

Facebook Page Comments Using Graph API & Stream Filter

I have my site working using the Facebook Comments Plugin as you can see here http://www.amanzitravel.com/namibia-wildlife-sanctuary
I am trying to use the Graph API to retrieve the comments so they are on the page in a form that is beneficial for SEO (as outlined here https://developers.facebook.com/docs/plugins/comments/).
Ideally I want to see not only all comments, but replies to comments. According to the API (https://developers.facebook.com/docs/graph-api/reference/v2.0/object/comments) using filter=stream should do the trick.
However when I do that I only get the two most recent comments e.g. https://graph.facebook.com/comments/?ids=http://www.amanzitravel.com/namibia-wildlife-sanctuary&filter=stream as opposed to the default https://graph.facebook.com/comments/?ids=http://www.amanzitravel.com/namibia-wildlife-sanctuary where I get all the top level comments but none of the replies.
EDIT: Further to this, it appears to update itself some time later, but when another reply is added it goes back to displaying a subset of all the comments for a period of time. Its unfortunate because it means I can't rely on this to be accurate.
Is there anyway I can make this work properly?

Facebook - posting scheduled posts on pages via Graph API

I've already read the facebook documentation which isn't quite clear. My question is, just like a page admin can manually add scheduled posts on their page, can my app, with the right access token, do the same? I've already tried using POST requests to set a 'created_time' on a future date but it just posts immediately.
Yes, use the scheduled_publish_time parameter when creating the post - this parameter is mentioned in the documentation you linked in multiple sections, where the parameters accepted when creating posts are listed, for example, in the 'Status Update' section:
https://developers.facebook.com/docs/reference/api/page/#statuses
Its value should be UNIX timestamp according to the documentation, though in many places in the Facebook API you can also use any date which is parseable by PHP's strtotime function so try that too.
Time when the page post should go live, this should be between 10 mins and 6 months from the time of publishing the post.
If you can't get this to work when specifying published to false, try setting it to 'true' at creation time
Contributing to the last answer (i'm not allowed to comment).
If you are trying to get the schedules post, you should use /{page-id}/promotable_posts. See https://developers.facebook.com/docs/graph-api/reference/page/feed/ for further details.

How to publish an action with tagged Google Places (or Maps)?

I'm having problem publishing actions (using OpenGraph) with tagged Google Places instead of Facebook Place. It should be straight forward according to the following document:
https://developers.facebook.com/docs/opengraph/location_tagging/#third_party
But every time I try to publish an action with place=http://GOOGLE_PLACE_URL I get the following error message:
The action you're trying to publish is invalid because the specified place 'http://GOOGLE_PLACE_URL' is invalid.
I've tried to put Google Maps, Google Places and Google+ Local URLs but all with the same problem.
Note: I could successfully publish actions when I set "place=Facebook_Place_ID".
Any help or hint is greatly appreciated!
Thank you,
I don't think Google's place pages have the markup necessary to support Open Graph
From the documentation:
Publishing actions with 3rd party places is similar to the location
tagging example above, except that you will pass in the url to another
site's place object.
The foursquare example in the documentation is defined as a place, as well as having the metadata foursquare uses:
https://foursquare.com/v/eataly/4c5ef77bfff99c74eda954d3
See Facebook's Debug Tool for that URL at https://developers.facebook.com/tools/debug/og/object?q=https%3A%2F%2Ffoursquare.com%2Fv%2Feataly%2F4c5ef77bfff99c74eda954d3 - it clearly shows that foursquare's place is defined as ‎og:type‎ playfoursquare:venue and has location data available for Facebook - i suspect Google does not have this on their place pages

How to access links provided on one's timeline?

I would like to have access to the links one shared on their timeline.
Using the API Graph Explorer, I see there is a way to access "links". However, it returns empty data. I believe that this might have been used when posting links in FB was done in a special way, different than posting "usual" status.
Then, I thought, I should probably get all the stream and filter the data for links. But at that point, I'm a little confused:
There are THREE different actions that seem to provide the very same data:
- https://graph.facebook.com/me/feed
- .../me/posts
- .../me/statuses
Are they actually all the same?
In addition, all seem to provide me information that is not up to date, but is true for some point in the near past. Moreover, I would like to know how I can get the relevant data from the beginning of the FB usage, or at least, for a given period of time.
Do an HTTP Get to me/links to get the most recent links the user has shared.
To limit it to a timeframe, you can do me/links?since=YYY&until=ZZZ.
Or you can use the paging object to get the previous and next url to use to get that other page of data.

Facebook Graph API SEO Comments and Profanity Filter

I'm trying to integrate the Facebook comments left on our site in a way in which the content can be crawled by search engines and also for people (although I highly doubt there will be many) who don't have Javascript enabled on their browser.
Currently our Facebook comments are displayed via the use of the Facebook comment social plugin (using the <fb:comments href="MY_URL" num_posts="50" width="665"></fb:comments> tag). This ends up rendering an iFrame (which are mostly ignored by search engine crawlers) so the plan is to render this information and format it with basic HTML. To do this, the comments are pulled using the Graph API - this is then only be displayed to crawlers and people with Javascript disabled.
This all works nicely using the Graph API call (https://graph.facebook.com/comments/?ids=MY_URL), parsing the JSON result and displaying it on the page. The problem is that the <fb:comments> approach filters our results based on a blacklist we have set up on one of our Facebook Apps. The AppId with the relevant blacklist is stored on the page using metadata (<meta property="fb:app_id" content="APP_ID"/>) which the <fb:comments> control obviously must somehow use to filter the comments.
The problem is the Graph API method does not filter any results as I guess no blacklist (or App Id containing a blacklist) is specified. Does anyone know how to specify a Facebook App ID to the API call URL or of another way to not fetch commnents back that violate the terms of the blacklist?
On a side note, I know the debate about filtering content in comments rages on but it is a management decision to implement the blacklist, and one that I have no influence in changing - just incase anyone felt the need to explain the reasons why content filtering is or isn't a good idea!
Any thoughts on a solution?
Unfortunately there's no way to access a filtered list of comments using the API - it might be a reasonably request to have this in the API - you should file a wishlist item in Facebook's bug tracker
Otherwise, the only solution I can think of is to implement your own filter on your side when retrieving and displaying the comments from the API.
According to the Comments plugin documentation the filter on Facebook's side is implemented as a simple substring match, so it should be trivial to implement.
A fairly simple regular expression match should be able to check each comment against a relatively long list quickly.
(Unfortunately, the tradeoff here is that implementing a filter is easy, but you'd also need to write an interface so that whoever's updating the list of disallowed words can maintain the list for both the Facebook plugin, and your own filtering.)
Quote from docs:
The comment is checked via substring matching. This means if you blacklist the
word 'at', if the comment contains the sequence 'a' 't' anywhere it will be
marked with limited visibility; e.g. if the comment contained the words 'bat',
'hat', 'attend', etc it would be caught.
Pretty sure there is no current way of doing this from the graph API, the only thing I can suggest is taking the blacklist and build your own filter