问题标签 [indieweb]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
facebook - Facebook Graph API: Find graph object from post URL
Given the URL of a public Facebook post, how can one find the post object in the FB Graph API? (secondarily, why are so many user feeds empty or nearly empty when accessed through the API?)
We would like to be able to comment on or like a post via the v2.x Graph API, given the post's URL. Doing so requires the post's object ID, which we can make some educated guesses about, but accessing the actual object through the API has proven unreliable (works for some posts but not others).
v2 of the API introduced app-scoped user IDs, and post IDs generally seem to be of the form {app-scoped user id}_{unique post id}. Here are the details of some attempts to find posts in the API with various combinations of these IDs (global user id, app-scoped user id, and post id).
Starting with a simple example: https://www.facebook.com/evan.prodromou/posts/10153023417510505. Key characteristics are that it's public, it's not a share of another post, and most importantly it has no photo(s), which add extra ids and URLs for the individual photo(s) and photo set. Evan's profile is also public, i.e. https://www.facebook.com/evan.prodromou doesn't show the generic This content is currently unavailable
Trying the bare post id from that URL, /v1.0/10153023417510505 and /v2.2/10153023417510505 both give the Unsupported get request (code 100) error.
Evan's global user id is 525575504. Attaching that as a prefix, /v1.0/525575504_10153023417510505 and /v2.2/525575504_10153023417510505 still both give the same Unsupported get request error.
Same error using his app-scoped user id instead, /v2.2/10152350676805505_10153023417510505.
OK let's try the other direction. We'll page through the user's feed until we find the post in question. It feels like this is more the expected use case for the API...
Both the global /v2.2/525575504/posts and app-scoped /v2.2/10152350676805505/posts return nothing, but /v1.0/525575504/posts returns two recent posts, this like and this post. Not sure why only those two, even though has plenty of other recent public posts. The like is fetchable via its
id
field in both api versions, i.e. /v1.0/525575504_10153045879215505 and /v2.2/10152350676805505_10153045879215505, but both API versions return the Unsupported get request error when fetching the post via its id field, e.g. /v1.0/525575504_351575675029953 and /v2.2/10152350676805505_351575675029953Trying another public post, this one with pictures: https://www.facebook.com/andigalpern/posts/678121182314631 . /v1.0/100003502653187_678121182314631, /v2.2/100003502653187_678121182314631, and /v2.2/499657186827699_678121182314631 all error.
/v1.0/100003502653187/posts only includes one post, a like, and /v2.2/100003502653187/posts is empty.
For reference, here is the GitHub issue where we have been tracking this problem.
openid - URL(不是域)是否适合 OpenID 2.0 身份?
我之前在indieweb 用例的上下文中使用过 OpenID 2.0 身份和委托 [1] ,其中假设每个用户控制一个域。所以一个身份看起来像https://example.com
OpenID 2.0 身份可以采用 URL 的形式,而不仅仅是一个域吗?例如,两者都https://example.com/alice
将https://example.com/bob
是:
- 有效、独立的身份
- 每个人都可以委托给一个单独的身份提供者吗
[1]不是OpenID Connect,不支持委托
jekyll - 将 Jekyll 帖子数据与来自 YAML 的数据相结合以创建新的博客提要
我想我什至不确定我应该寻找什么。在我的Jekyll 博客上,我目前只有一些博客文章,这些文章已经写好并在主页上列出了它们的全部内容并使用了分页。我想遵循更多独立网络标准并遵循PESOS(在其他地方发布,联合(到您的)自己的站点)方法。我想出了一种方法来自动从我的 Twitter 获取数据(例如 post_date、嵌入代码等)到 YAML 数据文件中。我想要做的是从我的帖子中获取数据并结合来自 Twitter 的数据并将这些帖子包括在内,就好像它们也是博客帖子一样(计划也对 Instagram 做同样的事情)。
我已经尝试了很多东西,但我什至不确定这样做的最佳方法是什么。我假设它将使用类似于Using Jekyll 的东西,如何使用 for 循环更改数组的内容?,但我似乎无法让它工作。我的博客文章代码目前如下: