Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tom Critchlow wants to run River5 on Glitch #22

Open
scripting opened this issue Apr 23, 2018 · 35 comments
Open

Tom Critchlow wants to run River5 on Glitch #22

scripting opened this issue Apr 23, 2018 · 35 comments

Comments

@scripting
Copy link
Owner

scripting commented Apr 23, 2018

Tom Critchlow wants to run River5 on Glitch. Has anyone had any success with this?

https://twitter.com/tomcritchlow/status/988452117823348736

Dave

@SparkyT
Copy link

SparkyT commented Apr 23, 2018

Yes to some extent :-) - http://newriver5.glitch.me/

Steps:

  • Start new glitch instance
  • Open the advanced options for the project, grant access to allow import/export
  • Import from GitHub (scripting/river5)
  • Go to config.json
    • Change config.json so you have extra lines as follows:
      "httpPort": 3000,
      "flDownloadPodcasts": false,
      image
      httpPort sets the port that Glitch likes so you don't need to fiddle anymore
      flDownloadPodcasts stops Glitch downloading all of the podcasts in the example feeds which can quickly fill up your Glitch instance
  • Wait for it to rebuild
  • Click on the "Show - Live" button, this jumps you to an https version of the Glitch instance (e.g. https://newriver5.glitch.me/). Due to there still being some references to the http version of fargo.io in the repo, change the address to be http instead (e.g. http://newriver5.glitch.me/). This should then show you what you want
  • You can then add new feeds into the relevant folder & have then show by editing config.json to add a new tab
  • Alternatively, just remix newriver5.glitch.me :-)

@tomcritchlow
Copy link

@SparkyT amazing! Thank you. I'm gonna check this out. Thanks

@scripting
Copy link
Owner Author

Questions for @SparkyT --

  1. Thanks for helping us out. That's the first thing I want to say. Now the questions.

  2. Someone told me that background tasks don't work on Glitch. Not sure what this means. River5 couldn't work without being able to set up some calls using setInterval.

  3. It looks like your server reset in the last hour or so, started reading feeds from scratch? Not sure if you restarted it, or something went wrong. Have you been using this River5 installation or is it something you set up as an experiment?

Dave

@scripting
Copy link
Owner Author

Looking at the dashboard I can answer one question --

http://newriver5.glitch.me/dashboard

The server has been up for 2.1 hours. :-)

Dave

@SparkyT
Copy link

SparkyT commented Apr 23, 2018

Isn't it always the way, you have something running nicely, share it and it all breaks :-( ?

I'm not sure how Glitch deals with the attempts to run continuously but it does go to sleep after a while and then completely rebuild/recreate the feeds when I go back to it.

It appears to have filled up the assigned space on the newriver5 instance (maybe due to it being up longer than my tests previously made happen). Getting it back up and working seems to require some wrangling which I will attempt now.

@scripting
Copy link
Owner Author

scripting commented Apr 23, 2018 via email

@scripting
Copy link
Owner Author

I added a one-line script here that loads a quick page on your server every five minutes.

http://newriver5.glitch.me/now

@SparkyT
Copy link

SparkyT commented Apr 24, 2018

Timezones meant I had to leave the conversation but the ride to work this morning triggered a memory or two

  • Glitch instances sleep after 2 minutes of inactivity and are destroyed (whatever that means) after 15 according to this post https://support.glitch.com/t/idle-time-before-sleep/376/4
    • I'm not sure what that means given that hitting the instance with an http request seems to keep it up.
  • In the past for testing I've user Uptime Robot (https://uptimerobot.com/) to do the pinging for me
  • Long term, Glitch probably isn't useful as anything than a testing ground for River5 mainly due to the issue above and the fact each instance has 128MB of storage (node modules don't count against this) so a large number of active feeds or having flDownloadPodcasts set to true will rapidly fill it up and leave you scrabbling around trying to get it back working again.
    • I've added in the feedBase.io top 100 feeds as an example and will now stop playing with this instance so it can be a reference that doesn't keep breaking :-)

@scripting
Copy link
Owner Author

Yes, I came to the same conclusion.

http://scripting.com/2018/04/24/124932.html

I like the way you used the feedBase top 100. Very inventive. ;-)

Dave

@cori
Copy link

cori commented Apr 24, 2018

I don't know anything about the configuration available for River5, but if the app's data could be stored in .data instead of in data, glitch maintains the content of that folder when the container is restarted, and it's also not copied on remix (so a remix wouldn't start out with someone else's River5 data folder contents).

@scripting
Copy link
Owner Author

Cori, that makes perfect sense, and River5 is totally configurable this way.

Here are the docs for config.json --

https://github.com/scripting/river5/blob/master/docs/CONFIG.md

If @SparkyT is listening --

All you should have to do is change the value of dataFolder in config.json to have the value ".data/".

All the data folders that River5 creates or looks for are in that folder.

Perfect. I like the way the designers at Glitch think.

Dave

@cori
Copy link

cori commented Apr 24, 2018

Great! I thought it might be but didn't see it in newriver5.glitch.com's config.json at a quick glance.

For reference there have been a number of efforts to port River5 to Glitch previously: https://glitch.com/search?q=river5

@scripting
Copy link
Owner Author

Cori, that means he's accepting the default. You only have to put things in config.json if you want to override the defult.

Adding this one line to his config.json should fix this problem --

"dataFolder": ".data/",

That should cause it to create all its data in a sub-folder of the Radio5 folder called .data

Dave

@SparkyT
Copy link

SparkyT commented Apr 24, 2018

Thanks all, dataFolder change made and stuff is being written there.

@scripting
Copy link
Owner Author

The app seems to be gone now.

I still wonder if what it's doing in the background is kosher.

I would search for setInterval in the Glitch docs and see if it has any problems with running code from those threads, or what happens to them when they shut off an app.

It could be they shut River5 down when it's in the middle of writing a file. That could definitely screw things up.

@scripting
Copy link
Owner Author

@cori -- I've been emailing with Anil Dash, and he says you work at Glitch now. That's really interesting. Maybe there's more we could do here. I told him that the .data approach is very good design, and it dovetails perfectly with the design of my apps. I guess we all have enough experience to have a sense for how data and code mix or don't mix. ;-)

@SparkyT -- thanks for sticking with this! I just checked the demo app, and it seems to still be running. That's really interesting. We now have a free place to deploy River5, and if there are any performance limits, it's really hard to see them.

Before closing this issue, I'd like to if possible work with you a bit on getting a really good clonable project there, a good demo for people to build from. I think all this can be done through work on config.json, and the lists folder, and writing a bit of docs.

The first question I have is how did you get the feedBase list in there? Did you take a snapshot? Or did you link to it from within a one-item list (that's the way to do it). I can help if you need it.

Also in config.json you can give titles to the tabs. The one for feedBase is awkwardly long. There are docs on this, I think. I'll go have a look now.

Anyway -- great teamwork! I love the braintrust. You guys are great. ♥️

@cori
Copy link

cori commented Apr 25, 2018

@scripting it's great that you're in contact with Anil. I do work at Fog Creek, although not on Glitch at the moment - my apologies if I wasn't diligent enough with a disclaimer; I didn't intend to muddy the waters. We've definitely got some really smart people working on Glitch!

Also for posterity if anyone runs across this issue in the future; you can remix the newriver5 project from https://glitch.com/edit/#!/newriver5 (since it can be a little hard to get from the public view to the editor without a little help).

@SparkyT
Copy link

SparkyT commented Apr 25, 2018

@scripting, yes - happy to tweak the setup so it works as a good template for people, just let me know what you want me to change or alternatively I can send you a link to collaborate on Glitch if you want to take it on?

The feedBase river is done with a single type="include" line in an opml file - I was going to ask whether you had implemented this, checked the docs one more time and there it was starting at me.

I wondered whether the river files should be put into .data/rivers as well so that they aren't copied over when people remix the project? Keeping the lists in the default folders seems a good compromise as then people who remix will see what lists are being used & how they are implemented.

@tomcritchlow
Copy link

I just want to chime in as the n00b who originally sparked this idea and say thank you! Looks like you're getting close to something that gives a beginner like me a way to get up and running with river5 in a few clicks which I think is a great thing. Really appreciate it.

@scripting
Copy link
Owner Author

@cori -- I didn't need a disclaimer. I recognize your name as a long-term Scripting News community person, I just wanted to close the loop. Totally appreciate the help. Please continue. ;-)

@SparkyT -- I'm glad you're using the include type. That's the right kind of example to propogate. I want all feed readers to have that feature! I know it's a tall order, but it's a good kind of network to build, really creates choice for users. You can send the same set of subscriptions to a variety of apps. As you did.

Anyway -- I think the only thing that needs to be done is edit the titles of the tabs on the home page. That's done through config.json, and it is documented here --

https://github.com/scripting/river5/blob/master/docs/CONFIG.md#configuring-the-home-page

I would prefer if you do the editing. ;-)

Let's shorten the first tab to "feedBase 100".

Name the second tab "World News" because that's what it seems that it is.

I guess the third tab is a sample list? Not sure what to call it. Maybe just eliminate it from the homePage array? Not sure. Two panels is probably enough for a demo.

You're right about the rivers folder, but 1. that's a change to the codebase, not the configuration and 2. it corrects itself almost immediately, overwriting the rivers with the ones it builds. So it's a "nice to have" thing, but I don't think it's an immediate thing to do (if ever).

@tomcritchlow -- you provided a reason to explore this, I wanted to know what Glitch was, and this is the most meaningful way for me to find out, make one of my apps work there. And you get an app to play with. I'm also a big believer in working together, so look at all the interesting people this has brought together, so that's the really big win. ;-)

@scripting
Copy link
Owner Author

@SparkyT -- here's a better idea

This is what the virgin River5 tab setup looks like

image

Make yours look like that. You could have your version of the Main tab point to the feedBase 100 OPML file. I really love that idea and want to preserve it.

Otherwise the NYT and Hacker News provide a pretty good set of extremes for a demo.

Dave

@SparkyT
Copy link

SparkyT commented Apr 25, 2018

OK, I'm adding the NYT and HN tabs back in so the app may disappear temporarily if they produce to much information for the Glitch limited space. If it does, I'll truncate the lists slightly to deal with it.

I saw the response to #23 which is great news as getting the https version working will be great given that's the default when one clicks "view" in Glitch. There is one other issue which I'll log separately once I can describe it sensibly relating to secure web sockets (wss://).

Tim

@scripting
Copy link
Owner Author

scripting commented Apr 25, 2018

@SparkyT -- I made the changes to eliminate the errors from the document.write includes.

I found a simple way to address it that I hadn't thought of earlier, since all the content is stored in S3 I can use their version of the address, which does support https. I didn't really need to use a CDN to get that feature. Wish I had thought of it earlier, could have saved a bunch of time.

There's another issue we should fix for the Glitch version, turning off the websockets interface. It's not working, and throwing a lot of errors.

The way to turn it off is to add this to config.json:

"flWebSocketEnabled": false,

Let me know when you do it, and I'll have a look at the remaining errors.

Dave

@yudel
Copy link

yudel commented Apr 25, 2018

It's no doubt premature, but I cloned the River5 installation using Glitch's clone feature. I changed some of the feeds. https://jazzy-pike.glitch.me/ reads the feeds, according to the dashboard, but the page itself shows blank.

Once this is all working , I'm eager to write a River5 for Poets guide for setting up a customized river of news on Glitch.

@scripting
Copy link
Owner Author

scripting commented Apr 25, 2018 via email

@yudel
Copy link

yudel commented Apr 25, 2018

And we're live at https://dew-quarter.glitch.me/
One sad thing I discovered is that many sites I'd like to include no longer have feeds.

@SparkyT
Copy link

SparkyT commented Apr 25, 2018

Thanks, "flWebsocketEnabled": false is set but strangely doesn't appear to be stopping the websocket connection attempts in the console when I view it.

@scripting
Copy link
Owner Author

scripting commented Apr 25, 2018

@SparkyT -- I fixed the problem where it was trying to connect to the websocket server if it's not enabled. It was literally a one-line fix. ;-)

To get the fix, just reload the page.

@SparkyT
Copy link

SparkyT commented Apr 25, 2018

@scripting - thanks, no more websocket errors :-)

I think this is OK enough now, let me know if you want anything else changing. The river5 name on Glitch isn't one of the ones I own I'm afraid so I can't switch to it. I'm glad we could get this working :-)

@yudel
Copy link

yudel commented Apr 27, 2018

So it's working, but the river that I added (by cloning myJsonFeeds.json and myJsonFeeds.js and adding myJsonFeeds to config.json) was read in once but isn't being updated. Any suggestions?

@SparkyT
Copy link

SparkyT commented Apr 27, 2018

@yudel , could you post the link to your remix and I'll have a quick look?

It may be something to do with the age of the newriver5 instance which might be affecting how somethings work when remixed - I'll create a fresh one this & send you that to try as well.

Tim

@scripting
Copy link
Owner Author

BTW -- @SparkyT -- it seems to still be working. When I log on I check the dashboard and see that it's been started a few seconds before. Meaning it's relaunching on every hit, potentially (I think they say they put it to sleep after five minutes of inactivity).

Then you have to reload the page a few times to get the really new stuff. It almost always finds new stuff after a period of inactivity.

This is a totally acceptable, and realistic use-case.

However it also says that having the websockets interface working would be a good thing here.

It might be worth finding out at some time why it wasn't working.

@yudel
Copy link

yudel commented Apr 27, 2018

I should note that the the other rivers work fine. The site is https://dew-quarter.glitch.me/

You can edit it at https://glitch.com/edit/#!/join/c4461cfd-e9a1-4a35-9aeb-be17dcf4147b

@yudel
Copy link

yudel commented Apr 30, 2018

Found the bug: An extra comma at the end of the list of feeds in myJewsNews.json

@tomcritchlow
Copy link

tomcritchlow commented Apr 19, 2022

I know it's been a few years but I'm still interested in this idea! Since this thread kicked off:

Most of the Glitch links in this thread unfortunately won't load for me. Would love a reference level Replit/Glitch instance that can be easily remixed and built on top of

Update: I tried to install river5 directly from Github into a Replit and it appears to work out of the box! No idea what happens over time.... https://river5.tomcritchlow.repl.co/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants