-
Notifications
You must be signed in to change notification settings - Fork 6
/
walkthrough.sh
105 lines (71 loc) · 4.13 KB
/
walkthrough.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/bin/sh
# (1) Start by installing the command-line tool.
go install github.com/social4git/social4git/social4git@latest
# (2) Make yourself two git repos, one public, one private
#
# For example, I use:
# https://github.com/petar/petar.social4git.public.git
# https://github.com/petar/petar.social4git.private.git
# I'll use these in the examples below.
#
# If people ask you what's your public social4git handle, its the URL to your public repo. In my case:
# https://github.com/petar/petar.social4git.public.git
# Needless to say, you can get creative and get yourself some cool DNS name for your handle, e.g.
# starstarer.eth
#
# Get yourself an access token (HTTP password) for these repos from your git provider.
# Let's call it ACCESS_TOKEN.
# (3) Create a config file for your social identity
mkdir -p $HOME/.social4git
cat <<EOF >> ~/.social4git/config.json
{
"handle": "https://github.com/petar/petar.social4git.public.git",
"public_url": "https://github.com/petar/petar.social4git.public.git",
"private_url": "https://github.com/petar/petar.social4git.private.git",
"public_auth": { "access_token": "ACCESS_TOKEN" },
"private_auth": { "access_token": "ACCESS_TOKEN" },
"var_dir": "/Users/petar/.social4git/var"
}
EOF
# The var_dir directory is where social4git will keep local caches of git repos it is working with.
# (4) You are ready to make your first post
# There are three different ways you can make a post:
# Here's a quick way to make a short post:
social4git post -m 'Howdy friends! Welcome to non-federated decentralized social media.'
# This will output a link to the post you just created, it will look something like:
# social4git-https://github.com/petar/petar.social4git.public.git?post=20230324175744_444563cf7e5d32c6eef15863c1dd2352fbbbffbf9a085c08f38b70bddbd8f611_fd01baf45c686d35981fe3ea31c9197a58d02c047f455b778b8311b93a851df0
# You can give this link to anyone. They can retrieve the post using `social4git fetch` (shown below).
# Here's another way to make a longer post:
social4git post <<EOF
We are just getting started, so we still maintain presence on Twitter @social4git and @maymounkov
EOF
# And another:
echo 'If you want to `retweet` a post, just post its link into a post. (Awkward phrasing, I know.)' > post3.txt
social4git post -f post3.txt
# (5) View your own posts:
social4git show --my
# Explore the command-line flags. There are many options when it comes to viewing:
social4git show -h
# (6) Follow someone:
social4git follow --handle https://github.com/petar/petar.social4git.public.git
# (7) See who you are following right now:
social4git following
# (8) See who someone else is following:
# This is useful for discovering new users.
social4git following --handle https://github.com/petar/petar.social4git.public.git
# (8) Unfollow someone
social4git unfollow --handle https://github.com/petar/petar.social4git.public.git
# (9) Fetch all posts from users you are following:
social4git sync
# This is a clever command. It will fetch the posts you're following and cache them both in your private repo (so you always have access to what you've once seen) and in a local cache on your machine for performance.
# (10) Now you can read the posts from folks you follow:
social4git show
# (11) You can always fetch the contents of a post, given a link to it:
social4git fetch --link social4git-https://github.com/petar/petar.social4git.public.git?post=20230324175744_444563cf7e5d32c6eef15863c1dd2352fbbbffbf9a085c08f38b70bddbd8f611_fd01baf45c686d35981fe3ea31c9197a58d02c047f455b778b8311b93a851df0
# (12) How do you `retweet`?
# For now, just make a post containing a link to the post you want to `retweet`.
social4git post -m social4git-https://github.com/petar/petar.social4git.public.git?post=20230324175744_444563cf7e5d32c6eef15863c1dd2352fbbbffbf9a085c08f38b70bddbd8f611_fd01baf45c686d35981fe3ea31c9197a58d02c047f455b778b8311b93a851df0
# We'll add more convenient functionalities as we go.
# If you are wondering who to follow, we'll keep a list of users who welcome followers:
# https://github.com/social4git/social4git
# Thanks for being curious!