Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Facebook service to latest Facebook Graph API version v18.0 and change field from engagement to og_object #186

Conversation

richard67
Copy link
Contributor

@richard67 richard67 commented Jun 12, 2022

Current Facebook Graph API version v18.0 has been released on September 12, 2023, see https://developers.facebook.com/docs/graph-api/changelog.

According to the changelog, there have not been any breaking changes regarding sharing counts, see https://developers.facebook.com/docs/graph-api/changelog/version18.0, so theoretically only the version number would have to be increased with this PR here.

But there is something which has been noted in the release notes of version v10.0 which has an impact on getting the share counters, see section "URL" https://developers.facebook.com/docs/graph-api/changelog/version10.0 :

URL

Applies to v10.0+. Will apply to all versions on May 25, 2021.

Engagement
- Due to privacy concerns, counts returned by a "GET /?id={url}/engagement" request may not match raw counts. 
- Requests for the "GET /?id={url}/engagement" field for the same URL will be limited to 10 requests per hour.

The first point seems to be the reason that the counters in the answer are all zero when using the existing code with just the version number changed, like I have done it many times with PR, the last one is #169 .

But if I change fields=engagement to fields=og_object{engagement} (or to be precise, fields=og_object%7Bengagement%7D with the curly brasckets encoded), then it works, and the response looks like:

{
   "og_object": {
      "engagement": {
         "count": 43,
         "social_sentence": "43 people like this."
      },
      "id": "132647790271874"
   },
   "id": "http://www.richard-fath.de/de/music/recordings/htlv-iii.html"
}

The count is the total of the 3 counts which are received with the current code without this PR.

This PR here makes the necessary changes to work that way. I also works with previous API versions in that way.

@richard67 richard67 changed the title Update Facebook service to latest Facebook Graph API version v14.0 and change field from engagement to og_object Update Facebook service to latest Facebook Graph API version v15.0 and change field from engagement to og_object Nov 14, 2022
@richard67 richard67 changed the title Update Facebook service to latest Facebook Graph API version v15.0 and change field from engagement to og_object Update Facebook service to latest Facebook Graph API version v16.0 and change field from engagement to og_object Feb 25, 2023
@richard67 richard67 changed the title Update Facebook service to latest Facebook Graph API version v16.0 and change field from engagement to og_object Update Facebook service to latest Facebook Graph API version v17.0 and change field from engagement to og_object Jun 2, 2023
@richard67 richard67 changed the title Update Facebook service to latest Facebook Graph API version v17.0 and change field from engagement to og_object Update Facebook service to latest Facebook Graph API version v18.0 and change field from engagement to og_object Sep 19, 2023
@digitalgopnik
Copy link
Contributor

@richard67 Thanks for you work! Will be merged 👍

@digitalgopnik digitalgopnik merged commit c055a2d into heiseonline:master Oct 25, 2023
@richard67 richard67 deleted the update-fb-graph-api-14.0-and-change-field branch October 25, 2023 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants