Android Tasker Shortcut to Post to New Card

The Tasker script below works in conjunction with Autoshare Profile trigger. Specifically it is triggered when I share a YouTube video with Autoshare Command. I then press the command button and it triggers the task below in tasker. The task sends the YouTube video link to a youtube link that returns the jason data on the YouTube link so that I can get the name of the video without all of the double quotes.

A1: Variable Set [
Name: %aslink
To: %astext
Max Rounding Digits: 3
Structure Output (JSON, etc): On ]

A2: HTTP Request [
     Method: GET
     URL: https://www.youtube.com/oembed?url=%astext&format=json
     Timeout (Seconds): 30
     Structure Output (JSON, etc): On ]

A3: Variable Set [
     Name: %astitle
     To: %http_data.title
     Max Rounding Digits: 3
     Structure Output (JSON, etc): On ]

A4: HTTP Request [
     Method: POST
     URL: https://api.supernotes.app/v1/cards/simple
     Headers: Api-key:MyKey
     Content-Type:application/json
     Body: {"name":"%astitle",
     "markup":"@[youtube](%aslink)",
     "tags":["videos", "to_watch"]}
     Timeout (Seconds): 30
     Trust Any Certificate: On
     Structure Output (JSON, etc): On
     Continue Task After Error:On ]

A5: Launch App [
     Package/App Name: Supernotes ]

This tasker script can be modified for other purposes as well.

3 Likes