reallysimple icon indicating copy to clipboard operation
reallysimple copied to clipboard

rssCloud bootcamp

Open scripting opened this issue 2 years ago • 40 comments

I want everyone to use rssCloud, it's very easy once you have code to crib.

right now I'm working on an OAuth connection to Mastodon, so I can hook FeedLand up to the Fedioverse.

I've heard some people are trying to get new rssCloud implementation working. I started this thread for them to ask questions, and maybe we can help (sure we can).

scripting avatar Nov 17 '22 14:11 scripting

I think I've got it set up on my feed okay — When it gets recreated I be got the ping to rpc.rsscloud.io working and it showed in the log 🤞

What I need to look at now is subscribing to feeds and then receiving the updates in my reader. I'll look at the documentation and fire questions here if I need to.

colin-walker avatar Nov 18 '22 21:11 colin-walker

@colin-walker — great!

scripting avatar Nov 18 '22 21:11 scripting

@scripting Quick question: the feed is definitely okay and I have an endpoint (/notify) responding correctly to the /pleaseNotify challenge. The logs on rpc.rsscloud.io shows that it was notifying me when I made a change (lastbuilddate) ... but ... how is that notification sent so that I can react to it in /reader?

Thanks.

colin-walker avatar Nov 19 '22 19:11 colin-walker

@colin-walker --

The cloud server will call you according to what's in the cloud element in your feed. If you want me to help figure out exactly what that is, you need to include the feed URL. (Update: At this point I misunderstood the question. It was a long day slogging through OAuth code.)

Also, it's better not to direct general questions to me personally, people are less likely to help if they think you want the help from one person in particular. Lots of years of experience with this. ;-)

scripting avatar Nov 19 '22 20:11 scripting

Understood :)

It's my normal feed.

I copied the cloud element from other feeds:

<cloud domain="rpc.rsscloud.io" port="5337" path="/pleaseNotify" registerProcedure="" protocol="http-post"/>

I can register successfully but need to just sort out how to process the notifications.

colin-walker avatar Nov 19 '22 22:11 colin-walker

@colin-walker -- I just re-read your initial question and it's confusing, and that's probably the problem. :-)

There are three actors in this setup.

  1. The feed, which has a cloud element that tells a subscriber how to request notification.

  2. The CMS that pings the cloud server when the feed updates.

  3. The aggregator that gets notified by the cloud server when the feed updates.

I think your question is about #3?

The aggregator has to connect with the cloud server every 24 hours to renew the subscription, otherwise it ages out.

You seem to say that is already set up.

So maybe the only thing you're missing is the ping, #2?

I have code you can look at for examples if you're good with JavaScript.

scripting avatar Nov 19 '22 22:11 scripting

Example code to look at --

  1. For the ping -- daverss package.

  2. For renewing subscriptions, River5.

scripting avatar Nov 19 '22 23:11 scripting

@colin-walker, here is another example code I ran earlier this month (using Dave Winer code examples):

https://andysylvester.com/2022/11/09/demo-of-rsscloud-protocol-and-reallysimple-npm-module/

andysylvester avatar Nov 19 '22 23:11 andysylvester

Thanks guys. I'm working in PHP.

Let me try to rephrase:

  1. The feed has the cloud element (hopefully it's got the correct info)

  2. Each time the feed is rebuilt it fires off a ping and the log on rpc.rsscloud.io showed that was successfully received

  3. I was able to successfully subscribe via /pleaseNotify and the logs indicated that I should have been notified in response to the pings. (This has all been within a 24 hour period so renewing the subscription is not an issue at present.)

My question is:

  • how does the notification happen and what do I need in the reader to receive it?

Is that any clearer?

Thanks again. Sorry if I'm being dumb and missing something.

colin-walker avatar Nov 19 '22 23:11 colin-walker

OK I can answer that.

Here's the data that River5 sends to the cloud server when renewing a subscription.

		var theRequest = {
			url: urlServer,
			followRedirect: true, 
			headers: {Accept: "application/json"},
			method: "POST",
			form: {
				port: port,
				path: path,
				url1: urlFeed,
				protocol: "http-post"
				}
			};

The notice from the cloud server comes to you as an HTTP request on the indicated port and path.

That's it. That's how it calls you.

scripting avatar Nov 19 '22 23:11 scripting

If you look at this function (https://github.com/andysylvester/myStatusDemo/blob/main/rssCloudTestOriginal02.js#L72), your app should be able to respond to a POST from the rssCloud server (if I understand the protocol correctly).

andysylvester avatar Nov 19 '22 23:11 andysylvester

Thanks. That's what I was thinking but couldn't get it to work.

I've tweaked it and am now seeing "failed to notify" messages in the log.

What is the format of the http request it sends for the notification?

Does it send a challenge with the notification the same as with pleaseNotify?

colin-walker avatar Nov 20 '22 00:11 colin-walker

According to the docs, it's an HTTP-POST with one value in the body the URL of the feed that updated.

http://walkthrough.rsscloud.co/

scripting avatar Nov 20 '22 00:11 scripting

The challenge is exactly the same as what you receive as notification.

You can figure all this stuff out with a debugger or writing to the log. Can't you do that in PHP?

scripting avatar Nov 20 '22 00:11 scripting

I've implemented rssCloud in PHP. Here's some code if that helps: https://gitlab.com/dobrado/dobrado/-/blob/master/php/cloud.php

mblaney avatar Nov 20 '22 00:11 mblaney

I will work on C# / .NET 7 implementation.

dodyg avatar Nov 20 '22 08:11 dodyg

@dodyg -- that's great! just like old times. ;-)

@colin-walker -- just checking in to see how it's going if you can use any help.

scripting avatar Nov 20 '22 14:11 scripting

Got the chance to look at it again today and it's now working. Realised I was making a stupid mistake: I was giving the path as /notify but this auto-redirects to /notify/notify.php and, in doing so, the POST variable was getting reset and the notification failed. Changing to the full path has it working.

Now I just need to cycle through each feed in my reader and send a subscribe once every 24 hours where there is a cloud element. 👍

colin-walker avatar Nov 22 '22 15:11 colin-walker

@colin-walker -- that's the way it goes. i spent four days trying to get a basic Hello World call to work using Mastodon's API.

There was one bit where I guessed wrong about something, and forgot that I did it. Working on this stuff puts you in haze. But it's a nice feeling when you get it figured out.

Let me know when I can tell people about what you did. Proud of your accomplishment. ;-)

scripting avatar Nov 22 '22 16:11 scripting

@scripting Thanks :) I'm going to be blogging about it all when I return to posting properly on Friday. I just need to ensure that /reader updates correctly and the subscriptions are renewed okay and will then be all good to go.

colin-walker avatar Nov 22 '22 17:11 colin-walker

@colin-walker -- okay cool. if you need help, just say the word, and when you're ready please post the url in this thread. ok?

scripting avatar Nov 22 '22 17:11 scripting

Quick question: when subscribing, is it better to send one request with url1, url2, etc. or is it okay to send multiple requests with just one feed? Do multiple requests cause any issues?

colin-walker avatar Nov 22 '22 20:11 colin-walker

@colin-walker -- it's fine to send one request per feed. That's how FeedLand does it. That was something we put in because the WordPress guys wanted it. I guess they deal in much larger sets of feeds.

scripting avatar Nov 22 '22 22:11 scripting

Looks like everything is working \o/

@scripting your new scripting.news posts arrived in my reader without me doing a manual pull.

I set up an email alert to let me know when I received a notification from rsscloud, checked /reader and there they were!

Thanks for all your help.

colin-walker avatar Nov 23 '22 14:11 colin-walker

I have a static blog built with eleventy. I wanted to implement RSSCloud, but a web search with "eleventy" or "Jamstack" came up with nothing. My host supports supports serverless functions, so I wrote one to ping http://rpc.rsscloud.io every time the blog deploys. Now my posts show up immediately on http://feedland.org. 😃 I wrote a quick post with the code.

scotthansonde avatar Nov 23 '22 19:11 scotthansonde

I have announced cloud support here

colin-walker avatar Nov 25 '22 12:11 colin-walker

Colin, I pushed it out via my linkblog.

I will write about this project on Scripting News, I want to point people at the bootcamp.

I also need to create better docs, I don't like the walkthrough -- too chatty. We can do better now.

Right now am working on getting Radio3 to work with Masto. Configuring for all the servers is an order of magnitude more complicated that Twitter, with only one server to work it out with. ;-)

scripting avatar Nov 25 '22 15:11 scripting

Indeed, especially with all the individual terms server admins may place on using them, not that I can imagine anyone really worrying about their API used that way.

As a side note, does the Scripting News nightly feed not ping with updates? I don't receive notifications for it.

colin-walker avatar Nov 25 '22 16:11 colin-walker

@colin-walker -- a few of my many feeds don't ping. wouldn't surprise me if the nightly one didn't. i'll swing around to it when i get a chance. ;-)

scripting avatar Nov 25 '22 16:11 scripting

I am investigating if WordPress.com support for rssCloud works. I think there is a problem, I created a WordPress.com forum post (https://rsscloud4.wordpress.com/2022/12/04/rss-cloud-support-in-wordpress-com-not-working/) to document the issue. I do not think it is a problem with FeedLand, but posting it on this thread for awareness. My next step is to look at the WordPress plugin for RSS Cloud (https://wordpress.org/plugins/rsscloud/) to see if there are issues there.

andysylvester avatar Dec 05 '22 00:12 andysylvester