npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

t-dm

v0.2.3

Published

Send and read Direct Messages on Twitter from the command line

Downloads

13

Readme

#Twitter Direct Messages - t-dm Send and read Twitter's DMs using Twitter's API from the command line.

##Installing

$ npm install t-dm -g

##Usage:

###Initializing To get the app to identify as you, you'll have to run the following command just once:

$ tdm init

It'll prompt you to visit a URL, that URL will ask you to identify the app on twitter, and then it'll show you a code. Back on the command line, enter that code and the app will save your tokens on a local json file.

###Sending:

To send a message, just run the following command:

$ tdm destination_user_name "The complete message"

Note that if your message is longer than 140 characters, TDM will split it into as many parts as required and it'll send all parts sequentially.

###Receiving / Reading

With TDM you can do both: listing the latest 20 messages of your inbox, or reading a specific message. Here is how:

####Listing inbox In order to read the latest 20 messages of your inbox, just use the following command:

$ tdm read inbox

You'll get a list of messages with the id of the message, the screen name of the sender, when was it send, and a small part of the text. Something like this:

--- [ Inbox ](last 20 messages) ---
[403959669888401400] FROM: deleteman123 - 11/22/2013 - 4:54:25 pm - This message is too ...
[403951109326524400] FROM: lookingfor_pr - 11/22/2013 - 4:20:24 pm - Testing short message
[364477670723043300] FROM: siavash - 08/5/2013 - 5:07:03 pm - Thank you so much for followin...
[352955266691657700] FROM: ProgrammingCom - 07/4/2013 - 10:01:07 pm - Thank you so much for followin...
[326768482609930240] FROM: bullsprig_js - 04/23/2013 - 3:44:11 pm - Thanks for the follow! Check o...
[315868386716430340] FROM: coderbits - 03/24/2013 - 1:51:06 pm - Here is your beta invitation f...

 To read the full content of a message, do: `tdm read ID` (where ID is the first number shown above)```

####Reading a specific message If you want to the the full content of a specific message, just use the ID listed above, like this:

$ tdm read 315868386716430340

And you'll get something like this:

--- [ Message from: deleteman123 on 11/20/2013 - 4:44:20 pm ] ---
Hey, this is the text message received! Cool uh!?

##Running this code locally

If you've downloaded the code and want to try it for yourself, you'll have to register an app on the twitter dev site and rename the file under /lib/twitter-keys-sample.json to /lib/twitter-keys.json filling in the tokens required.

##Contribute

Please, feel free to fork, improve and create a pull request! All contributions are welcomed! :) Also, if you want to get in touch with me, you can send e-mails to: [email protected]

##License The MIT License (MIT)

Copyright (c) 2013 Fernando Doglio

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.