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

Update documentation for add links to shiori in android devices from share menu #757

Merged
merged 10 commits into from Oct 22, 2023
34 changes: 34 additions & 0 deletions docs/Usage.md
Expand Up @@ -8,6 +8,7 @@ Before using `shiori`, make sure it has been installed on your system. By defaul
- [Using Web Interface](#using-web-interface)
- [Improved import from Pocket](#improved-import-from-pocket)
- [Import from Wallabag](#import-from-wallabag)
- [Add URL to Shiori from Android](#Add-URL-to-Shiori-from-Android)

<!-- /TOC -->

Expand Down Expand Up @@ -154,3 +155,36 @@ inside the container.
chmod +x wallabag2shiori
./wallabag2shiori 'path/to/to/wallabag_export_json_file'
```


## Add URL to Shiori from Android


1. Install [Temux](https://termux.dev/en/)
2. Open temux and run bellow command
```bash
mkdir -p ~/bin
touch ~/bin/termux-url-opener
chmod +x ~/bin/termux-url-opener
nano ~/bin/termux-url-opener
```
3. Edit bellow code and replace `Shiori_URL`, `Username`, `Password` with yours
```bash
#!/bin/bash

# shiori settings
Shiori_URL="http://127.0.0.1:8080"
Username="shiori"
Password="gopher"

token=$(curl -s -X POST -H "Content-Type: application/json" -d '{"username": "'"$Username"'" , "password": "'"$Password"'", "remember": true}' $Shiori_URL/api/v1/auth/login | grep -oP '(?<="token":")[^"]*')

curl -s -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $token" -d '{ "url": "'"$1"'", "createArchive": false, "public": 1, "tags": [], "title": "", "excerpt": "" }' $Shiori_URL/api/bookmarks
exit
```
4. Paste above content in editor and `Volume-down` and `o` than Enter to save file.
5. `Volume-down` and `x` to exit editor.
6. close termux


You can share links with termux from Share menu links will automatically add to Shiori from mobile device.