# Fedi Link Fetcher A pair of PHP scripts that extract links from your Mastodon / gotosocial / snac bookmarks and add them to: - Read Later in Readeck (simple API token) - Watch Later in YouTube Playlist (Google oAUTH API) ## 1. Getting a Readeck token In Web UI: - Settings, API tokens, Create API Token - Check Bookmarks Read + Write Save it in: ``` /_credentials/readeck_account.txt ``` Just add one line like: ``` readeck.instance.com|YOUR_TOKEN ``` ## 2. Getting mastodon / snac / gotosocial tokens You can either user the respective web UI or just use the [Token Generator here](https://takahashim.github.io/mastodon-access-token/) , just set the URL, login, and get the token back Save one account per line in: ``` /_credentials/fedi_accounts.txt ``` Just add one line per user like this (you can have several times the same instance as the token determines the user): ``` mastodon.social|YOUR_TOKEN mastodon.social|YOUR_TOKEN my.instance.org|YOUR_TOKEN ``` The script will loop on each account but always save on the same readeck / youtube accounts. ## 3. Getting a Youtube API token (it's a tad more complicated...) - 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 Save it as: ``` /_credentials/client_secret.json /_credentials/token.json ``` ## 3. Add your Google account as a test user - Go to Google Cloud Console > OAuth consent screen - ~> Audience - Under “Test users” - Add your Google email for your Youtube account ## 4. Download Google API Client with PHP Composer ``` composer require google/apiclient:^2.0 ``` ## 5. Run command to get (or recreate) a token and create FediList playlist ``` ./update_google_token.php ``` ## 6. Add the command to your cron to fetch the links regularly ``` */5 * * * * /home/snac/fedi_slurp/fedi_slurp.php > /home/snac/logs/fedi_slurp.log 2>&1 ```