? Editing: Post:21.body Save Delete Cancel
Content changed Sign & Publish new content

BinChan's ZeroNotes

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)

Follow in NewsfeedFollowing

TOC by date
TOC by tag
View in light theme

Latest comments:

Add new post

Title

21 hours ago · 2 min read ·
3 comments

tag:
Body
Read more

Not found

Idea: Add More Cmdline Support For ZeroNet And Zites

on Mar 02, 2018
tag: cmd zeronet

I'm interested in adding more command line support for ZeroNet and zites, though I doubt if I will use them very often XD Some hardcore GNU/Linux, BSD devs/hackers will like them I guess. As mentioned in this post on ZeroMe, if there some APIs (more supports), a dev on GNU/Linux or BSD can even easily do everything with cmdline, with super low system requirement, as no need for a GUI system setup.

Currently what I have is: A Shell Script for Manually Signing User Content, and some bots which can be transformed for cmdline usage. Signing and publishing content.json with cmd takes too long time, because zeronet.py tries to start a new instance first [Edit 1]. Guess it's possible to add an option for avoiding it, and the process can also be thrown to background, too.

And here are some rough ideas:

$ zerohello list feeds -> List newsfeeds, with feed_id
$ zerohello reply feed:FEED_ID -> Reply to a post/comment/mention
$ zeromail list -> List new zeromail
$ echo "Hello!" | zeromail reply binchan2 -> Reply to ZeroMail, or with cat tmp_reply.md for long text.
$ zerotalk list | grep zeronet -> List new topics on ZeroTalk with keyword "zeronet", topics are all with topic_id.
$ zerotalk list topics:binchan2 -> List all topics of a user
$ zerotalk show topic:TOPIC_ID -> Show topic and comments of a topic
$ zerotalk follow topic:TOPIC_ID -> Follow a topic, aka add a topic to ZeroHello Newsfeeds timeline.
$ zerotalk comment topic:TOPIC_ID -> comment to a topic
$ zerome create profile -> create a new profile on ZeroMe (with interactive script)
$ zerome show post:POST_ID -> Show a post (image to ASCII) and its comments
$ zerome --interactive -> Run ZeroMe in interactive mode, with screen or tmux for multiple windows.

Also here is the awesome cli apps list on Github, if someone wants to explore some related projects.

Edit 1: here is zeronet-websocket for using websocket in cmdline, with it we can sign and publish content, run ZeroFrame API cmd without trying to start a new ZeroNet instance first. Thank 空澄砂夜 (Sorasumi Sayo) for the suggestion and the work!

Edit 2: zeronet-websocket from edit 1 is based on Nodejs, now we also have Python version of ZeroFrame API websocket wrapper and cmd examples for ZeroNet, ZeroName, etc. Thank Git Center!

Edit 3: Wow! Now websocket call is directly supported in official ZeroNet \o/

Pack a websocket client to allow run any ZeroFrame API call from command line using. Eg.: zeronet.py siteCmd 1yoursite fileGet content.json

9 Comments:

user_name1 day ago
Reply
Body
schiz0on Jun 19, 2018
Reply

it would be fantastic a ZeroMe-mode like identica-mode on emacs

binchan2on Mar 04, 2018
Reply

gitcenter: GitHub
zeronet and zeroname are now implemented!

Awesome! And thank you for adopting my ideas!

gitcenteron Mar 03, 2018
Reply

GitHub

zeronet and zeroname are now implemented!

zeronet.py

$ zeronet config set root_directory ~/Documents/ZeroNet

$ zeronet socket 1EiMAqhd6sMjPG2tznkkGXxhdwFBDdeqT9 fileGet --inner_path "data/users/content.json"
{
 "address": "1EiMAqhd6sMjPG2tznkkGXxhdwFBDdeqT9",
 "files": {},
 "ignore": ".*",
 "inner_path": "data/users/content.json",
 "modified": 1510413627,
 "signs": {
  "1EiMAqhd6sMjPG2tznkkGXxhdwFBDdeqT9": "Gwt3s6c0RkWdztLh8yirijqqqwcL2h4uOTaUToUVkU6oJMTAM1cAYBupJo0gu11CHLueFsTbzv5LrxPUiL3FvpM="
 },
 "user_contents": {
  "cert_signers": {
   "zeroid.bit": ["1iD5ZQJMNXu43w1qLB8sfdHVKppVMduGz"]
  },
  "permission_rules": {
   ".*": {
    "files_allowed": "data.json",
    "max_size": 10000
   },
   "bitid/.*@zeroid.bit": {"max_size": 40000},
   "bitmsg/.*@zeroid.bit": {"max_size": 15000}
  },
  "permissions": {
   "banexample@zeroid.bit": false,
   "binchan2@zeroid.bit": {"max_size": 100000},
   "nofish@zeroid.bit": {"max_size": 20000},
   "schiz0@zeroid.bit": {"max_size": 100000}
  }
 }
}

$ zeronet account master
ea706489c5c00f9c9372dbb98c4ebda10068871da84441f6d1ac48989cf724a7

$ zeronet certs list
zeroid.bit
kaffie.bit
cryptoid.bit

$ zeronet certs address zeroid.bit
1Cy3ntkN2GN9MH6EaW6eHpi4YoRS2nK5Di

$ zeronet certs privatekey zeroid.bit
5ng***************************LHqWEkHYZiA

$ zeronet certs username zeroid.bit
gitcenter

$ zeronet instance running && echo Running || echo Not running
Running

$ zeronet instance pid
3460

$ zeronet instance shutdown

$ zeronet instance start

$

zeroname.py

$ zeroname resolve zeroid.bit
1iD5ZQJMNXu43w1qLB8sfdHVKppVMduGz

$ zeroname lookup 1GitLiXB6t5r8vuU2zC6a8GYj9ME6HMQ4t
gitcenter.bit

$ zeroname alias Blog.ZeroNetwork.bit
nofish.bit
subdomain.futureshock.bit
subdomain.dropsite.bit
blog.chomping-at-the.bit
blog.miao.bit
subdomain.dropsitefoodnetwork.bit
blog.payby.bit
subdomain.dedox.bit
subdomain.baker-gamer.bit
blog.shilei.bit
zerowikipedia.bit
subdomain.takingcare.bit
subdomain.cannabisindica.bit
blog.zeronetwork.bit
0blog.bit
subdomain.mmostudio.bit
subdomain.10011001.bit
subdomain.ddox.bit
blog.shadowsocks.bit
subdomain.dropsites.bit
subdomain.cannabissativa.bit
subdomain.releaselist.bit
subdomain.anonews.bit
subdomain.kuchmak.bit
subdomain.dedos.bit
subdomain.releasehq.bit
gitcenteron Mar 02, 2018
Reply

binchan2: So.. you are that hardcore dev :D And before you anwser me, I silently added more ideas to the list :3

Hm... I think I'll start implementing!

caryosceluson Mar 02, 2018
Reply

Many "display" commands can be easily implemented and wouldn't require running 0net instance or using extra api as they would consist of some formatting of sql requests. I'll probably get to implementing some of that if nobody makes it first, since sometimes running browser just to check updates isn't the best option.

Also, though not exactly an one-off shell script, there's https://github.com/imachug/ThunderProxy for ThunderWave <-> irc bridge (haven't tried it though).

binchan2on Mar 02, 2018
Reply

gitcenter: Why not? :D

So.. you are that hardcore dev :D And before you anwser me, I silently added more ideas to the list :3

gitcenteron Mar 02, 2018
Reply

binchan2: You want to implement them?

Why not? :D

binchan2on Mar 02, 2018
Reply

gitcenter: Is Python okay for you? Writing what you said here won't be difficult.

Sure, there are quite some websocket libs for python. You want to implement them? I don't know if some people will use them in their daily life. If a hardcore dev/hacker will, maybe s/he can just create those things by her/himself and share them online

gitcenteron Mar 02, 2018
Reply

Is Python okay for you? Writing what you said here won't be difficult.

Select user
  • Welcome to ZeroMessage!
This page is a snapshot of ZeroNet. Start your own ZeroNet for complete experience. Learn More