davidbauer / Instacurate

Turn your Twitter timeline into a personalised news site, in an instant. Fetches links from your timeline and displays them in a discovery friendly design.
http://www.instacurate.com
113 stars 29 forks source link

Steps for Reddit integration #94

Closed davidbauer closed 10 years ago

davidbauer commented 10 years ago

The Reddit part with be accessed via instacurate.com/s/reddit (s for source), for now based on a separate instance.

  1. Take a subreddit as input (either via search form or from a list of suggestions – we had both in an earlier version of Instacurate for Twitter usernames)
  2. Get the list of "hot" posts to that subreddit (http://www.reddit.com/dev/api#GET_hot)
  3. Extract link urls from those posts, extract metadata like username, timestamp
  4. Send link to Embed.ly, create teaser elements based on info obtained from Embed.ly (no changes needed here)
  5. Push teaser elements to html.
davidbauer commented 10 years ago

This actually looks pretty straightforward. With http://www.reddit.com/r/news.json I get the "hottest" posts from a subreddit, "news" here, and with kind == "t3" I get only the link posts.

Available data from one post.

{
            "kind": "t3",
            "data": {
                "domain": "theguardian.com",
                "banned_by": null,
                "media_embed": {},
                "subreddit": "news",
                "selftext_html": null,
                "selftext": "",
                "likes": null,
                "secure_media": null,
                "link_flair_text": null,
                "id": "1qh2zr",
                "secure_media_embed": {},
                "clicked": false,
                "stickied": false,
                "author": "trai_dep",
                "media": null,
                "score": 2458,
                "approved_by": null,
                "over_18": false,
                "hidden": false,
                "thumbnail": "",
                "subreddit_id": "t5_2qh3l",
                "edited": false,
                "link_flair_css_class": null,
                "author_flair_css_class": null,
                "downs": 2067,
                "saved": false,
                "is_self": false,
                "permalink": "/r/news/comments/1qh2zr/occupy_wall_street_activists_buy_15m_of_americans/",
                "name": "t3_1qh2zr",
                "created": 1384311679.0,
                "url": "http://www.theguardian.com/world/2013/nov/12/occupy-wall-street-activists-15m-personal-debt",
                "author_flair_text": null,
                "title": "Occupy Wall Street activists buy $15m of Americans' personal debt: Rolling Jubilee spent $400,000 to purchase debt cheaply from banks before 'abolishing' it, freeing individuals from their bills.",
                "created_utc": 1384282879.0,
                "ups": 4525,
                "num_comments": 404,
                "visited": false,
                "num_reports": null,
                "distinguished": null
            }