Search code examples
pushbullet

Filter Pushes by Type


I'm working on building a bash script that will listen for pushes of the type link which will then extract just the URL and write it to a local file.

The idea is to be able to gather links I find and save them for automated processing later.

However, it doesn't appear that the API allows you to filter by type - only by active, modified_after, cursor, and limit - which seems a bit sparse to me, but oh well.

Since type isn't a filterable option, I'm assuming that I will need to add an additional step to parse the JSON returned and filter out any that don't have the type I'm looking for, then pass those to another step to extract the link and write it down to a file.

Before I go bashing (heh) my head against the wall writing this, is anyone aware of something that will already handle this, or at least keep me from re-inventing part of the wheel?


Solution

  • I've solved this issue by using jq to process and filter the json payload, allowing me to only select the types of pushes that I want.