Messy Notes about using ZeroNet and other things
All code published here are under CC-BY-SA licence, if not compatible, then MIT license X)
This is a python script that will turn a ZeroMe Profile into a RSS feed reader.
RSS (Rich Site Summary; originally RDF Site Summary; often called Really Simple Syndication) uses a family of standard web feed formats to publish frequently updated information: blog entries, news headlines, audio, video. An RSS document (called "feed", "web feed", or "channel") includes full or summarized text, and metadata, like publishing date and author's name. Src:Wiki
/path/to/zeronet/data/users.json, delete it and restart ZeroNet. Create a new ID (ZeroID, KaffieID, etc).
Clone a hub (Don't mess up existing hub, newcomers will be disappointed when they find only Robots and Zombies in the public timeline. Also you can control your post storage limit with your own hub, or suffer this
content.json: Include too large 277327 > 50000 ... Sign failed: Invalid content XD), then login ZeroMe with your new ID and your hub.
Create a folder named
FeedBot under your ZeroNet root directory:
$ cd /path/to/zeronet && mkdir FeedBot
Download the script file ↗ or copy it from Nullpaste to the folder, also under
FeedBot folder create an empty file named with
PS: One-line command:
$ cd /path/to/zeronet && mkdir FeedBot && cd FeedBot && touch rssAddresses.txt && wget https://git.gnu.io/chbinnc/Userscripts/raw/master/FeedBot/feedbot.py
Add your feeds:
There are two way to add your feeds:
One way is to directly copy your feed url to
rssAddresses.txt, one url one line.
The other way is to create post with your bot ZeroMe account. The format is
add-feed YOUR_FEED_URL. Your can also delete your feed with
del-feed URL. That's cool, isn't it ;) You can also use your major ZeroMe account to add and delete feed url. Check the code to add the feature by yourself :P
/path/to/zeronet/data/users.json (You need to copy your bot site address, id auth address and auth key later when first time running the script), restore your major
users.json and restart ZeroNet.
Run the script:
Install package dependency
$ pip install feedparser or with other method. Then simply run it with
$ python feedbot.py. If you want to run it periodically, you can use
$ watch -n TIME_INTERVAL_IN_SECOND -x python feedbot.py. The script normally won't fetch anything if there are no new content. But some websites don't support
last-modified header, the script has to always fetch feeds from them, but still won't update anything.
PS: On my Raspberry pi 2
watch doesn't work together with
tmux, so I use this one instead:
$ while sleep TIME_INTERVAL_IN_SECOND; do python feedbot.py; done.
feedparser package doesn't support timeout setting, so you need to install it from another branch. How to:
$ pip uninstall feedparser.
$ git clone https://github.com/JPFrancoia/feedparser && cd feedparser && python setup.py install --user