Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mews

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mews - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

33

lib/mews/twitter.js

@@ -8,10 +8,23 @@ const request = require('request')

) => {
let {possibly_sensitive} = this
let oauth = {consumer_key, consumer_secret, token, token_secret}
let {possibly_sensitive, in_reply_to_status_id, dm} = this
possibly_sensitive = +possibly_sensitive
request.post('https://api.twitter.com/1.1/statuses/update.json', {
oauth: {consumer_key, consumer_secret, token, token_secret},
formData: {status, possibly_sensitive}
})
if(dm.length) {
let formData = {text: status}
if(~dm.search(/\D/)) {
formData.screen_name = dm.replace(/^@/, '')
} else {
formData.user_id = dm
}
request.post('https://api.twitter.com/1.1/direct_messages/new.json', {
oauth, formData
})
} else {
request.post('https://api.twitter.com/1.1/statuses/update.json', {
oauth,
formData: {status, possibly_sensitive, in_reply_to_status_id}
})
}
}

@@ -21,3 +34,11 @@

possibly_sensitive: false,
sensitive() {this.possibly_sensitive = !this.possibly_sensitive}
sensitive() {this.possibly_sensitive = !this.possibly_sensitive},
in_reply_to_status_id: '',
replyTo: {
get() {this.in_reply_to_status_id = ''},
set(val) {this.in_reply_to_status_id = val}
},
dm: ''
}

2

package.json
{
"name": "mews",
"version": "1.1.0",
"version": "1.1.1",
"description": "trust your output to a mews",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -174,2 +174,5 @@ # mews

* `mew.sensitive` *toggle*. Flags your tweet as potentially containing sensitive content.
* `mew.replyTo = ''` *string*. The ID of a tweet you would like to reply to. You would need some other way of finding a tweet ID, and you also need to include `@username` in your tweet message, where `username` is the username of the account that tweeted the tweet.
* `mew.dm = ''` *string*. If this is set, your message will be sent as a DM to a recipient specified by this value. If this value contains only digits, it will be treated as a user ID. If it contains anything other than digits, it will be considered a username. A `@` at the beginning of usernames is optional, unless the person you are trying to message has a username that is all digits.
* `mew.in_reply_to_status_id` *alias*. `mew.replyTo`
* `mew.possibly_sensitive` *alias*. `mew.sensitive`

@@ -176,0 +179,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc