This repository contains a Cloud Function designed for Google Cloud Platform's v2 Cloud Functions. It is intended to integrate with Omnivore.app's webhook system, triggering actions in Pocket. When Omnivore.app sends a webhook, this function processes the data and posts the bookmark data to Pocket's API.
omnivoreToPocketSync
automates the process of transferring new bookmarks from Omnivore.app directly into your Pocket account. This functionality is especially beneficial for those who have shifted from using Pocket to Omnivore for their bookmarking needs, enabling them to sync their newly added Omnivore content back to their Pocket collection.
Before running this function, it's crucial to import your existing Pocket bookmarks into Omnivore first. Failing to do so will trigger a repetitive cycle where bookmarks are endlessly transferred back and forth between Pocket and Omnivore. 🔁 This function is specifically tailored for users who have fully embraced the Omnivore bookmark system and wish to mirror their Omnivore-bookrmark-saved content in Pocket.
- Register your application with Pocket at Pocket Developer Apps. You might name it
omnivoreToPocketSync
. - Request the necessary permissions for your app.
- After creating the app, note down the
consumer_key
provided.
- Open Postman and create a new request.
- Set the HTTP method to POST.
- Enter the URL:
https://getpocket.com/v3/oauth/request
. - Under Headers, add these on two rows:
Content-Type: application/json; charset=UTF-8 X-Accept: application/json
- In the Body section, select
raw
and JSON format, then enter:Replace{ "consumer_key": "YOUR_CONSUMER_KEY", "redirect_uri": "YOUR_REDIRECT_URI" }
YOUR_CONSUMER_KEY
with your Pocket consumer key. ForYOUR_REDIRECT_URI
, use a URI where you want Pocket to redirect post-authorization (e.g.,http://github.com
). - Send the request and note down the request token from the response.
- Construct the authorization URL:
Replace
https://getpocket.com/auth/authorize?request_token=YOUR_REQUEST_TOKEN&redirect_uri=YOUR_REDIRECT_URI
YOUR_REQUEST_TOKEN
andYOUR_REDIRECT_URI
with the content from Step 2 - Navigate to this URL in a web browser. You'll be redirected to the specified URI upon successful authorization.
- Set up a new POST request in Postman to
https://getpocket.com/v3/oauth/authorize
. - Add Headers:
Content-Type: application/json
- In the Body, include:
{ "consumer_key": "YOUR_CONSUMER_KEY", "code": "YOUR_REQUEST_TOKEN" }
- Send the request. The successful response will include the Pocket access token.
- Go to Google Cloud Functions and create a new function.
- Name it
omnivoreToPocketSync
. - Choose "Allow unauthenticated invocations" under authentication.
- Copy the trigger URL.
- In the editor, paste the function code into
index.js
and update theconsumerKey
andaccessToken
with your values from Steps 1 and 4. Name your endpointomnivoreToPocketSync
. - Next, paste the package file into
package.json
- Deploy the function.
- Visit Omnivore Webhooks Settings.
- Enter the trigger URL you copied from the Cloud Function setup in step 5