RSS-Bridge / rss-bridge

The RSS feed for websites missing it
https://rss-bridge.org/bridge01/
The Unlicense
7.2k stars 1.03k forks source link

Request: Ello #683

Closed Tallefer closed 6 years ago

Tallefer commented 6 years ago

Since you moved to CURL, I think it is more convenient now to request this bridge. The main reason — Ello's own notification system (sends digests to email) seems quite unreliable, sometimes it is silent for weeks, then several updates in one week, no matter how many posts were made in the meantime. And the closest thing to RSS is the homepage feed https://ello.co/feeds/editorials which works fine, but certainly it is not enough. Secondly, while happily storing them, Ello is not sharing artwork originals easily, and that is important, because of lossy compression. But API does provide a way to get them. So, I request user feeds at least, and search feeds as a bonus. Fortunately, since Ello is mainly an art-inspired site, most users that are worth a visit do not generate content more often than 1-2 times a day, so no need for frequent polls and heavy traffic. Some projects based on Ello API are found here on GitHub and in the wild. But to save time and make things more convenient, I will post an example here about how it could be done in console. Some useful links: https://gist.github.com/conatus/cc665f917d5558c123bc https://evdokimovn.github.io/elloapi/#introduction https://ellov2.docs.apiary.io/# https://github.com/ello/api-docs

1) Get the API token, it expires after 24 hours (not sure about that)

curl "https://ello.co/api/webapp-token"
{"token":{"token_type":"bearer","expires_in":86400,"created_at":1525107208,"access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzUxMiJ9.eyJpc3MiOiJFbGxvLCBQQkMiLCJpYXQiOjE1MjUxMDcyMDgsImp0aSI6ImVjZjIwYmFiYmNhM2E1NzYyYmI0ZDk5ODQxMjA2MWQzIiwiZXhwIjoxNTI1MTkzNjA4fQ.TKcEhP8fF-s96428vtJOQ7gwmFh6eWs2oT895dryV4HHsRZccdbiI32Z2Qj1ZIwXcKule6r-PNgkj-3THoABp9ntWURJVBqQ9EH88R1w8niHocJ3G5J5Ofq1y_2-kseakg5_JSevUIlgA8zHlrNkDUr86QVD5Xv5vgXGfvhlgYLG5w0N5-SN741QdY-m0q3mgjXsEQX25MnksdORNjdJkmx2oGCKAxjWHcK5Pq6HWuljFdvpB-boXQLf9w_6vEzsNWnhqJsZ38CcsMlwjnxjwKnKtUbtjV6wwMEXmSDdIsoJmENZrtzlrfT7uQwt9TWVAZtIYFENtEVqd6ahPQ4JA"}}

2) Use API to list a feed, it is more or less straightforward, so let's assume we have chosen a post already for processing.

3) User — eboy , post — aelk0rjs-rev-izrrjan6g , let's get us some json:

curl "https://ello.co/api/v2/posts/~aelk0rjs-rev-izrrjan6g?comment_count=false&user_id=~eboy" -H "Host: ello.co" -H "Accept: application/json" -H "Accept-Language: en-US,en;q=0.5" --compressed -H "Content-Type: application/json" -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzUxMiJ9.eyJpc3MiOiJFbGxvLCBQQkMiLCJpYXQiOjE1MjUxMDcyMDgsImp0aSI6ImVjZjIwYmFiYmNhM2E1NzYyYmI0ZDk5ODQxMjA2MWQzIiwiZXhwIjoxNTI1MTkzNjA4fQ.TKcEhP8fF-s96428vtJOQ7gwmFh6eWs2oT895dryV4HHsRZccdbiI32Z2Qj1ZIwXcKule6r-PNgkj-3THoABp9ntWURJVBqQ9EH88R1w8niHocJ3G5J5Ofq1y_2-kseakg5_JSevUIlgA8zHlrNkDUr86QVD5Xv5vgXGfvhlgYLG5w0N5-SN741QdY-m0q3mgjXsEQX25MnksdORNjdJkmx2oGCKAxjWHcK5Pq6HWuljFdvpB-FboXQLf9w_6vEzsNWnhqJsZ38CcsMlwjnxjwKnKtUbtjV6wwMEXmSDdIsoJmENZrtzlrfT7uQwt9TWVAZtIYFENtEVqd6ahPQ4JA" -H "origin: https://ello.co" -H "Connection: keep-alive" -k
{"posts":{"watching":false,"views_count":202891,"token":"aelk0rjs-rev-izrrjan6g","summary":[{"links":{"assets":"7472627"},"link_url":null,"kind":"image","data":{"url":"https://assets1.ello.co/uploads/asset/attachment/7472627/ello-optimized-b6c891f2.jpg","alt":null}},{"link_url":null,"kind":"text","data":"<p>Neural Network Recipe for Popular Science Magazine</p>"}],"reposts_count":1,"reposted":false,"repost_id":"","repost_content":[],"meta_attributes":{"url":"https://ello.co/eboy/post/aelk0rjs-rev-izrrjan6g","title":"Neural Network Recipe Popular S - eboy | ello","robots":"index, follow","images":["https://assets2.ello.co/uploads/asset/attachment/7472627/ello-hdpi-b6c891f2.jpg"],"embeds":null,"description":"Neural Network Recipe for Popular Science Magazine","canonical_url":null},"loves_count":54,"loved":false,"links":{"categories":["1"],"author":{"type":"users","id":"12196","href":"/api/v2/users/12196"},"assets":["7472627"]},"is_adult_content":false,"id":"15212781","href":"/api/v2/posts/15212781","created_at":"2018-04-10T08:51:56.564373Z","content_warning":"","content":[{"links":{"assets":"7472627"},"link_url":null,"kind":"image","data":{"url":"https://assets1.ello.co/uploads/asset/attachment/7472627/ello-optimized-b6c891f2.jpg","alt":null}},{"link_url":null,"kind":"text","data":"<p>Neural Network Recipe for Popular Science Magazine</p>"}],"comments_count":0,"body":[{"kind":"image","data":{"url":"https://assets1.ello.co/uploads/asset/attachment/7472627/ello-optimized-b6c891f2.jpg","asset_id":7472627}},{"kind":"text","data":"Neural Network Recipe for Popular Science Magazine"}],"author_id":"12196","artist_invite_submission_id":null,"artist_invite_submission":{"title":null,"status":null,"slug":null},"artist_invite_id":null},"linked":{"users":[{"views_adult_content":false,"username":"eboy","total_views_count":2452620,"relationship_priority":null,"posts_count":255,"posts_adult_content":false,"name":"eBoy","loves_count":94,"location":"","links":{"categories":[]},"is_hireable":true,"is_community":null,"is_collaborateable":false,"id":"12196","href":"/api/v2/users/12196","has_sharing_enabled":true,"has_reposting_enabled":true,"has_loves_enabled":true,"has_commenting_enabled":true,"has_auto_watch_enabled":true,"formatted_short_bio":"","following_count":19,"followers_count":8214,"external_links_list":[{"url":"http://hello.eboy.com/eboy/","text":"hello.eboy.com/eboy/"},{"url":"http://www.patreon.com/eboyarts","type":"Patreon","text":"www.patreon.com/eboyarts","icon":"https://social-icons.ello.co/patreon.png"},{"url":"http://twitter.com/eboyarts","type":"Twitter","text":"twitter.com/eboyarts","icon":"https://social-icons.ello.co/twitter.png"},{"url":"http://shop.eboy.com/","text":"shop.eboy.com/"}],"experimental_features":false,"cover_image":{"xhdpi":{"url":"https://assets2.ello.co/uploads/user/cover_image/12196/ello-xhdpi-dbe5225a.jpg","metadata":{"width":1488,"type":"image/jpeg","size":889775,"height":837}},"original":{"url":"https://assets0.ello.co/uploads/user/cover_image/12196/ello-1dd3ddd1-aae6-4cff-8c8d-c6862dba9609.png"},"optimized":{"url":"https://assets1.ello.co/uploads/user/cover_image/12196/ello-optimized-dbe5225a.jpg","metadata":{"width":2560,"type":"image/jpeg","size":746778,"height":1440}},"mdpi":{"url":"https://assets0.ello.co/uploads/user/cover_image/12196/ello-mdpi-dbe5225a.jpg","metadata":{"width":368,"type":"image/jpeg","size":68810,"height":207}},"ldpi":{"url":"https://assets0.ello.co/uploads/user/cover_image/12196/ello-ldpi-dbe5225a.jpg","metadata":{"width":176,"type":"image/jpeg","size":16203,"height":99}},"hdpi":{"url":"https://assets1.ello.co/uploads/user/cover_image/12196/ello-hdpi-dbe5225a.jpg","metadata":{"width":736,"type":"image/jpeg","size":277849,"height":414}}},"badges":["featured","experimental","creator-type:art"],"bad_for_seo":false,"avatar":{"small":{"url":"https://assets0.ello.co/uploads/user/avatar/12196/ello-small-c63d8565.png","metadata":{"width":60,"type":"image/png","size":959,"height":60}},"regular":{"url":"https://assets0.ello.co/uploads/user/avatar/12196/ello-regular-c63d8565.png","metadata":{"width":120,"type":"image/png","size":1174,"height":120}},"original":{"url":"https://assets0.ello.co/uploads/user/avatar/12196/ello-0d3b8d4e-9582-40c1-9b0d-ff49197bab59.png"},"large":{"url":"https://assets2.ello.co/uploads/user/avatar/12196/ello-large-c63d8565.png","metadata":{"width":360,"type":"image/png","size":1394,"height":360}}}}],"posts":[],"categories":[{"uses_page_promotionals":false,"tile_image":{"small":{"url":"https://assets1.ello.co/uploads/category/tile_image/1/ello-small-e31c72d4.jpg","metadata":{"width":360,"type":"image/jpeg","size":99283,"height":360}},"regular":{"url":"https://assets1.ello.co/uploads/category/tile_image/1/ello-regular-e31c72d4.jpg","metadata":{"width":600,"type":"image/jpeg","size":229564,"height":600}},"original":{"url":"https://assets2.ello.co/uploads/category/tile_image/1/ello-optimized-bf694c45.jpg"},"large":{"url":"https://assets1.ello.co/uploads/category/tile_image/1/ello-large-e31c72d4.jpg","metadata":{"width":800,"type":"image/jpeg","size":366917,"height":800}}},"slug":"art","order":0,"name":"Art","links":{"recent":{"related":"/api/v2/categories/art/posts/recent"}},"level":"primary","is_sponsored":false,"is_creator_type":true,"id":"1","header":"Art","description":"Discover a diverse range of visual and performance work that explores many forms, genres, and styles including traditional techniques such as painting, drawing, and sculpting, as well as more contemporary forms such as site specific art, digital, and virtual reality.","cta_href":"","cta_caption":"","allow_in_onboarding":true}],"assets":[{"id":"7472627","attachment":{"xhdpi":{"url":"https://assets1.ello.co/uploads/asset/attachment/7472627/ello-xhdpi-b6c891f2.jpg","metadata":{"width":1500,"type":"image/jpeg","size":230285,"height":1700}},"original":{"url":"https://assets2.ello.co/uploads/asset/attachment/7472627/ello-3cb4647b-0277-4ef1-8f67-9ea5ad08ac20.png"},"optimized":{"url":"https://assets1.ello.co/uploads/asset/attachment/7472627/ello-optimized-b6c891f2.jpg","metadata":{"width":1710,"type":"image/jpeg","size":253663,"height":1938}},"mdpi":{"url":"https://assets1.ello.co/uploads/asset/attachment/7472627/ello-mdpi-b6c891f2.jpg","metadata":{"width":375,"type":"image/jpeg","size":25338,"height":425}},"ldpi":{"url":"https://assets2.ello.co/uploads/asset/attachment/7472627/ello-ldpi-b6c891f2.jpg","metadata":{"width":180,"type":"image/jpeg","size":9218,"height":204}},"hdpi":{"url":"https://assets2.ello.co/uploads/asset/attachment/7472627/ello-hdpi-b6c891f2.jpg","metadata":{"width":750,"type":"image/jpeg","size":63674,"height":850}}}}]}}

4) Now, we need only the originals, not the "optimized" or "xhdpi" which Ello normally shares, and they can be picked by their "original" tag, so:

…
"original":{"url":"https://assets2.ello.co/uploads/asset/attachment/7472627/ello-3cb4647b-0277-4ef1-8f67-9ea5ad08ac20.png"}
…

results in https://assets2.ello.co/uploads/asset/attachment/7472627/ello-3cb4647b-0277-4ef1-8f67-9ea5ad08ac20.png

The End. :) Thank you for your project!

Tallefer commented 6 years ago

@teromene Thank you, works great! A small correction would be nice, though: Each feed item should have a title and a link leading to selected post, because currently there is no convenient way to get from any image to its corresponding post. In html mode all tags lead simply to the root of ello site, in atom mode tags lead to https://[CURRENT_BRIDGE_URL]/search?terms=#[TAG] which results in 404, obviously.

teromene commented 6 years ago

This should be fixed in c4d489f