1 **************************************
2 shpub - micropub client for your shell
3 **************************************
4 Command line `micropub <https://micropub.net/>`_ client written in PHP.
12 shpub is released as self-contained ``.phar`` file that includes
17 See `shpub downloads page <http://cweiske.de/shpub-download.htm>`_
18 for all released versions.
23 When using the git version, you need to have the following dependencies
24 installed on your system:
27 - PEAR's `HTTP_Request2 <http://pear.php.net/package/HTTP_Request2>`_
28 - PEAR's `MIME_Type <http://pear.php.net/package/MIME_Type>`_
29 - PEAR's `NET_URL2 <http://pear.php.net/package/Net_URL2>`_
37 $ ./bin/shpub.php connect http://mywebsite
41 $ ./bin/shpub.php connect http://mywebsite http://mywebsite/user
43 If you pass a third parameter, then it will be the name of the connection.
44 You can select a specific server/connection with ``-s`` on all commands.
47 List configured servers/connections
48 ===================================
51 $ ./bin/shpub.php server
57 Also try ``server -v`` which lists server and user URLs.
63 shpub has support for the following post types:
65 - `article <http://indieweb.org/article>`_
66 - `bookmark <http://indieweb.org/bookmark>`_
67 - `like <http://indieweb.org/like>`_
68 - `note <http://indieweb.org/note>`_
69 - `reply <http://indieweb.org/reply>`_
70 - `repost <http://indieweb.org/repost>`_
71 - `rsvp <http://indieweb.org/rsvp>`_
73 ``shpub`` sends data form-encoded by default.
74 To send JSON requests, use the ``--json`` option.
81 $ ./bin/shpub.php like http://example.org/
82 Like created at server
83 http://anoweco.bogo/comment/23.htm
89 $ ./bin/shpub.php reply http://example.org/ "Hey, cool!"
90 Reply created at server
91 http://anoweco.bogo/comment/42.htm
98 $ ./bin/shpub.php note "oh this is cool!"
99 Note created at server
100 http://known.bogo/2016/oh-this-is-cool.htm
104 $ ./bin/shpub.php note -f image.jpg "this is so cute"
105 Note created at server
106 http://known.bogo/2016/this-is-so-cute
108 You can use ``-f`` several times to upload multiple files.
112 $ ./bin/shpub.php note -f http://example.org/1.jpg "img url!"
113 Note created at server
114 http://known.bogo/2016/img-url
120 You may delete and restore posts on micropub servers::
122 $ ./bin/shpub.php delete http://known.bogo/2016/like
124 Restore a deleted post::
126 $ ./bin/shpub.php undelete http://known.bogo/2016/like
132 Existing posts can be modified if the `server supports this`__::
134 $ ./bin/shpub update --add category=foo category=bar\
135 --replace slug=differentslug\
136 --delete category=oldcat\
137 http://known.bogo/2016/post
139 __ https://indieweb.org/Micropub/Servers#Implementation_status
145 Most post types allow file uploads. Simply use ``-f``::
147 $ ./bin/shpub.php note -f path/to/image.jpg "image test"
148 Note created at server
149 http://known.bogo/2016/image-test
151 The media endpoint is used automatically if the micropub endpoint has one.
152 To force shpub to directly upload the file and skip the media endpoint,
153 use the ``--direct-upload`` option::
155 $ ./bin/shpub.php note --direct-upload -f path/to/image.jpg "direct upload"
157 Use the ``upload`` command to upload files to the media endpoint without
160 $ ./bin/shpub.php upload /path/to/file.jpg /path/to/file2.jpg
161 Uploaded file /path/to/file.jpg
162 http://test.bogo/micropub-media-endpoint/1474362040.2941/file.jpg
163 Uploaded file /path/to/file2.jpg
164 http://test.bogo/micropub-media-endpoint/1474362040.3383/file2.jpg
170 To debug ``shpub`` or your micropub endpoint, use the ``--debug`` option
171 to see ``curl`` command equivalents to the shpub HTTP requests::
173 $ ./bin/shpub.php -s known -d note "a simple note"
174 curl -X POST -H 'User-Agent: shpub' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Authorization: Bearer abc' -d 'h=entry' -d 'content=a simple note' 'http://known.bogo/micropub/endpoint'
175 Post created at server
176 http://known.bogo/2016/a-simple-note
182 shpub's homepage is http://cweiske.de/shpub.htm
187 shpub's source code is available from http://git.cweiske.de/shpub.git
188 or the `mirror on github`__.
190 __ https://github.com/cweiske/shpub
195 shpub is licensed under the `AGPL v3 or later`__.
197 __ http://www.gnu.org/licenses/agpl.html
202 shpub was written by `Christian Weiske`__.
204 __ http://cweiske.de/