This program uses the Joplin API and Tweepy to read individual Twitter status URLs, grab their text and images, and store them into new notes in a Joplin notebook.
-
Copy the example configuration file and create your own
$ copy jopleet.config.example jopleet.config
Edit the file and fill in the values:
-
Open Joplin desktop (warning: tested on macOS only), open preferences and the Web Clipper section. Enable the Web Clipper Service which will make the REST API available.
-
In that same preference pane, under Advanced Options, you'll find the API authoriaation token. Copy this value into the value of
token
in your configuration file.token = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-
Create a Twitter dev account with the tokens you need. Their names are in the configuration file and you fill in the values accordingly.
-
Create a new notebook in Joplin into which jopleet will store all tweets. We also call this a folder -- in Joplin notebooks are called folders.
$ ./mk-folder.sh a001 { "title": "a001", "id": "491fea8acdb84ada8a766d9e17c3497e", "updated_time": 1602257565942, "created_time": 1602257565942, "user_updated_time": 1602257565942, "user_created_time": 1602257565942, "type_": 2 }
-
Copy the value of
id
above, without the double quotes into the value ofparent_folder =
in your configuration file.parent_folder = 491fea8acdb84ada8a766d9e17c3497e
-
Verify that the Markdown template in
jopleet.py
which will be written to each note is the way you want it to be; change accordingly. -
Create the Python environment
$ python3 -mvenv env.v3 $ env.v3/bin/pip install -r requirements.txt
-
Test it
$ env.v3/bin/python ./jopleet.py https://twitter.com/jpmens/status/1085859260783837185
-
The result ought to be a note in Joplin which looks like this
- Options option "-t" accepts a comma-separated list of existing tags which will be associated with the new note.