Comparing version 1.1.0 to 1.1.1
@@ -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: '' | ||
} |
{ | ||
"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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16434
191
185