Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

snarfed/ownyourresponses

Repository files navigation

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

  1. Clone this repo.

  2. Change MICROPUB_ENDPOINT in app.py to your site's endpoint.

  3. Generate a Micropub access token for your web site.

  4. Put it in a file called micropub_access_token in the repo root directory.

  5. Create a Twitter app and an Instagram app. (No Facebook yet, since their API doesn't expose your recent likes or comments.)

  6. 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, and instagram_access_token. Details here.

  7. Create an App Engine app, replace ownyourresponses in app.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

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

Instagram can get likes by user, but not comments.

Facebook

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.

About

Creates posts on your web site for your likes, replies, reshares, and event RSVPs on social networks.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published