fedi_slurp/README.md

59 lines
1.2 KiB
Markdown
Raw Permalink Normal View History

2025-05-21 00:44:19 +00:00
# Fedi Link Fetcher
A pair of PHP scripts that extract links from your Mastodon / snac bookmarks and add them to:
2025-05-21 01:29:40 +00:00
- Read Later in Readeck (simple API token)
- Watch Later in YouTube Playlist (Google oAUTH API)
2025-05-21 00:44:19 +00:00
2025-05-21 01:10:31 +00:00
## 1. Getting a Readeck token
2025-05-21 00:44:19 +00:00
2025-05-21 01:06:03 +00:00
In Web UI:
- Settings, API tokens, Create API Token
- Check Bookmarks Read + Write
Save it as:
```
/_credentials/token.json
```
2025-05-21 00:44:19 +00:00
2025-05-21 01:10:31 +00:00
## 2. Getting a Youtube API token
2025-05-21 00:44:19 +00:00
2025-05-21 01:00:52 +00:00
- Go to the Google Cloud Console:
- Project > APIs & Services > Credentials
- Create oauth client ID
- for TV and limited INPUT
- Download the OAuth 2.0 Client ID JSON file
2025-05-21 00:44:19 +00:00
2025-05-21 01:06:03 +00:00
Save it as:
2025-05-21 00:59:11 +00:00
```
2025-05-21 01:06:03 +00:00
/_credentials/client_secret.json
2025-05-21 00:59:11 +00:00
```
2025-05-21 00:44:19 +00:00
2025-05-21 01:10:31 +00:00
## 3. Add your Google account as a test user
2025-05-21 01:00:52 +00:00
- Go to Google Cloud Console > OAuth consent screen
- ~> Audience
- Under “Test users”
- Add your Google email for your Youtube account
2025-05-21 00:44:19 +00:00
2025-05-21 01:10:31 +00:00
## 4. Download Google API Client with PHP Composer
2025-05-21 00:44:19 +00:00
2025-05-21 00:59:11 +00:00
```
2025-05-21 00:44:19 +00:00
composer require google/apiclient:^2.0
2025-05-21 00:59:11 +00:00
```
2025-05-21 01:25:21 +00:00
## 5. Run command to get (or recreate) a token and create FediList playlist
2025-05-21 01:12:58 +00:00
```
2025-05-21 01:25:21 +00:00
./update_google_token.php
2025-05-21 01:12:58 +00:00
```
2025-05-21 00:59:11 +00:00
2025-05-21 01:12:58 +00:00
## 6. Add the command to your cron to fetch the links regularly
2025-05-21 00:59:11 +00:00
```
*/5 * * * * /home/snac/fedi_slurp/fedi_slurp.php > /home/snac/logs/fedi_slurp.log 2>&1
```
2025-05-21 00:44:19 +00:00