Add blogroll

This commit is contained in:
2024-02-11 14:40:46 +11:00
parent d83dac92a5
commit 0bafc3722a
13 changed files with 188 additions and 3 deletions

View File

@@ -0,0 +1,30 @@
require "httparty"
module Adamantium
module Queries
module Blogroll
class Index
include Deps["settings"]
def call
resp = HTTParty.get("https://#{settings.rss_url}/api/greader.php/reader/api/0/subscription/list?output=json", {
headers: {
"Authorization" => "GoogleLogin auth=#{auth_token}"
}
})
resp.body
end
private
def auth_token
auth_url = "https://#{settings.rss_url}/api/greader.php/accounts/ClientLogin?Email=#{settings.rss_username}&Passwd=#{settings.rss_password}"
resp = HTTParty.get(auth_url)
auth = resp.match(/SID=(.*)/)
auth[1].strip
end
end
end
end
end