Skip to content

Instantly share code, notes, and snippets.

@citrusui
Last active June 13, 2023 17:58
Show Gist options
  • Star 28 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save citrusui/b1acfa1bc13a0dcdbe8307668fa18f21 to your computer and use it in GitHub Desktop.
Save citrusui/b1acfa1bc13a0dcdbe8307668fa18f21 to your computer and use it in GitHub Desktop.
How to add a fancy Direct Message button to your Tweets https://twitter.com/citrusui/status/719279185123012609

How to add a fancy Direct Message button to your Tweets

Step 1: Go to tweeterid.com and enter your username.

Step 2: Copy your user ID from the previous website.

Step 3: Copy the following URL:

https://twitter.com/messages/compose?text=example%20text&recipient_id=1001

Step 4: Replace example%20text with whatever you want the message to say. Your message must be ASCII-encoded. W3Schools has a reference guide that helps explains ASCII encoding (URL encoding) and even has a tool that will encode text into ASCII for you.

Step 5: Replace 1001 with the user ID you received from step 2.

Step 6: Tweet the URL you just devised to the world.

@arjayslife
Copy link

What to do you mean by CHARACTERS MUST BE ESCAPED?

@citrusui
Copy link
Author

@arjayslife See this link for more information on URL encoding (sometimes called URL "escaping") https://www.w3schools.com/tags/ref_urlencode.ASP

@citrusui
Copy link
Author

citrusui commented Jul 2, 2021

Calling something "trash" is not very helpful or descriptive.

I noticed the website to grab Twitter IDs that was linked in the Gist is now run by a spammer. I've replaced the link and it should work again. Please be nicer next time.

@febri-strange
Copy link

OMG this is so cool. it works, totally. thanks for great idea! this is what i need

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment