ownyourresponses
Creates posts on your web site for your likes, replies, reshares, and event RSVPs on social networks. In IndieWeb terms, PESOS as a service.
See PESOS for Bridgy Publish for background on the motivation.
Uses Micropub. Your web site must have a Micropub endpoint. (Here's one for WordPress, for example.)
This project is placed in the public domain. You may also use it under the CC0 license.
Setup
Setup
-
Clone this repo.
-
Change
MICROPUB_ENDPOINT
inapp.py
to your site's endpoint. -
Generate a Micropub access token for your web site.
-
Put it in a file called
micropub_access_token
in the repo root directory. -
Create a Twitter app and an Instagram app. (No Facebook yet, since their API doesn't expose your recent likes or comments.)
-
Put their app ids and secrets and access tokens in the repo root directory in files named
twitter_app_key
,twitter_app_secret
,twitter_access_token
,instagram_client_id
,instagram_client_secret
, andinstagram_access_token
. Details here. -
Create an App Engine app, replace
ownyourresponses
inapp.yaml
with your app id, and deploy.
...and you're done! Comment or like or retweet something, and it should automatically create a new post on your web site.
Silo API details
Twitter has a streaming API that sends events for new favorites and tweets (including @-replies and retweets). Bridgy has used it before. It broke when Bridgy went over 100ish Twitter users, but it would work for just one user. Even so, it's a bit expensive on App Engine, so I'd probably just poll /statuses/user_timeline
and /favorites/list
.
Google+
Google+ has no way to get comments or +1s by user, only by post. API docs; feature request; SO answer.
Instagram can get likes by user, but not comments.
Facebook's Real Time Updates should work. I've already used it in ownyourcheckin. I'd subscribe to /user/likes
and /user/feed
, which I think should include likes and comments. I could also poll those endpoints.
...ugh, except they only tell me that I liked or commented on something, not what I liked or commented on. Here are example objects from those API endpoints:
{
"id": "212038_10101426802642863",
"from": {"id": "212038", "name": "Ryan Barrett"},
"story": "Ryan Barrett likes a post.",
"story_tags": {...},
"type": "status",
"created_time": "2014-12-26T17:41:20+0000",
"updated_time": "2014-12-26T17:41:20+0000"
}
{
"id": "212038_10101488100217033",
"from": {"id": "212038", "name": "Ryan Barrett"},
"story": "Ryan Barrett commented on his own photo.",
"story_tags": {...},
"type": "status",
"created_time": "2015-02-02T16:40:44+0000",
"updated_time": "2015-02-02T16:40:44+0000"
}
I can generate links from the ids that go to the appropriate stories, e.g. https://www.facebook.com/212038/posts/10101426802642863 and https://www.facebook.com/212038/posts/10101488100217033 , but I can't get the story or comment contents via the API. :(
Update: They fixed this in API v2.3!
As of March 25, 2015 We now send content in Page real-time updates (RTUs). Previously, only the object's ID was in the RTU payload. Now we include content in addition to the ID including: statuses, posts, shares, photos, videos, milestones, likes and comments.