alfred-twitter-toolkit icon indicating copy to clipboard operation
alfred-twitter-toolkit copied to clipboard

Add support for `dm @username` to compose a new message

Open chrismessina opened this issue 4 years ago • 1 comments
trafficstars

Ideally Alfred would offer autocomplete, but that's too advanced for me...

Since DMs require numerical user IDs, I'll have to find a way to convert a username to the corresponding user ID and then initiate a new DM URL in the form:

https://twitter.com/messages/{var:userId}-{query}?text=

And also add a non-exporting userId to the environmental variables.

chrismessina avatar Jan 06 '21 08:01 chrismessina

This could possibly be implemented as a List Filter where the flow would be like:

  1. Authenticate a local Twitter client to get one's followee list; store the list containing IDs, usernames, and display names
  2. Load this list as a CSV into a List Filter
  3. Use dm to access type-to-suggest completion using that List Filter in Alfred's UI
  4. upon actioning, open the URL prefilled with https://twitter.com/messages/{var:userId}-{query} (where query is the user ID of the recipient)
  5. if a space is typed after the username, use that text to prefill message text

chrismessina avatar May 06 '21 23:05 chrismessina