New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.0.6 to 1.1.0

lib/mews/twitter.js

26

lib/index.js

@@ -5,3 +5,3 @@ const fs = require('fs'), path = require('path'), util = require('util')

exports = module.exports = (name, fn) => {
let mew = () => {
let mews = () => {
if(typeof fn !== 'function') fn = require(fn)

@@ -39,3 +39,3 @@ if(typeof fn !== 'function') throw new Error(`required file "${name}" doesn't export a function`)

property.get = opts => opts[key] = value
property.set = opts => arg => opts[key] = Number(arg)
property.set = opts => arg => opts[key] = +arg
break

@@ -98,12 +98,13 @@

let getter = (getterProp = props, ...getterArgs) => {
let nextMew
let mew
getterProp = Object.assign({}, getterProp)
if(getterArgs.length === target) {
nextMew = (...format) => {
mew = (...format) => {
fn.call(Object.assign({}, getterProp), util.format(...format), ...getterArgs)
return getter(getterProp, ...getterArgs)
}
Object.defineProperty(mew, 'name', {value: `${name} mew`})
} else {
nextMew = (...args) => {
mew = (...args) => {
let myArgs = getterArgs.concat(args.splice(0, target - getterArgs.length))

@@ -113,5 +114,6 @@ if(args.length) return getter(getterProp, ...myArgs)(...args)

}
Object.defineProperty(mew, 'name', {value: `incomplete ${name} mew`})
}
Object.defineProperties(nextMew, properties(getterProp, newProp => getter(newProp, ...getterArgs)))
return nextMew
Object.defineProperties(mew, properties(getterProp, newProp => getter(newProp, ...getterArgs)))
return mew
}

@@ -124,4 +126,4 @@

mew = () => ({getter, setter})
return mew()
mews = () => ({getter, setter})
return mews()
}

@@ -131,7 +133,9 @@

configurable, enumerable,
get: () => mew().getter(),
set: (...args) => mew().setter(...args)
get: () => mews().getter(),
set: (...args) => mews().setter(...args)
})
}
Object.defineProperty(exports, 'name', {value: 'mews'})
fs

@@ -138,0 +142,0 @@ .readdirSync(path.join(__dirname, 'mews'))

@@ -1,6 +0,3 @@

const https = require('https')
const request = require('request')
let hostname = 'api.telegram.org', method = 'POST'
let headers = {'Content-Type': 'application/json'}
exports = module.exports = function(text, token, chat_id) {

@@ -10,4 +7,2 @@ let match = /(?:bot)?(\d+:[-\w]+)/.exec(token)

let path = `/bot${token}/sendMessage`
let {

@@ -18,9 +13,11 @@ parse_mode, disable_web_page_preview,

https
.request({hostname, method, path, headers})
.on('error', e => {})
.end(JSON.stringify({
disable_web_page_preview = +disable_web_page_preview
disable_notification = +disable_notification
request.post(`https://api.telegram.org/bot${token}/sendMessage`, {
formData: {
chat_id, text, parse_mode, disable_web_page_preview,
disable_notification, reply_markup
}))
}
})
}

@@ -27,0 +24,0 @@

{
"name": "mews",
"version": "1.0.6",
"version": "1.1.0",
"description": "trust your output to a mews",

@@ -27,3 +27,6 @@ "main": "lib/index.js",

},
"homepage": "https://github.com/stawberri/mew#readme"
"homepage": "https://github.com/stawberri/mew#readme",
"dependencies": {
"request": "^2.74.0"
}
}

@@ -7,3 +7,3 @@ # mews

mews are intended to make sending messages over [Telegram](https://telegram.org/) as easy as using `console.log`.
mews are intended to make sending messages on Telegram and Twitter as easy as using `console.log`.

@@ -138,3 +138,3 @@ ```js

* `botToken` *string*. Your telegram bot's API token. You get this when you create your bot, and can ask BotFather for it again with the `/token` command.
* `botToken` *string*. Your telegram bot's API token. [BotFather](https://telegram.me/BotFather) will tell give you this when you create a bot or use the `/token` command.
* `chatID` *string*. Your recipient's chat ID, which is usually a positive integer for users, a negative integer for groups, or a name for channels.

@@ -163,1 +163,22 @@ * `...output` Desired output.

```
### mew = mews.twitter(consumer\_key, consumer\_secret, token, token_secret, ...output)
Send a tweet on twitter with the provided app and account details. You can grab some from Twitter's [Application Management site](https://apps.twitter.com).
* `consumer_key` *string*. Twitter app consumer key (api key)
* `consumer_secret` *string*. Twitter app consumer secret (api secret)
* `token` *string*. Twitter user access token
* `token_secret` *string*. Twitter user access token secret
* `...output` Desired output.
#### twitter configuration
* `mew.sensitive` *toggle*. Flags your tweet as potentially containing sensitive content.
* `mew.possibly_sensitive` *alias*. `mew.sensitive`
```js
let mew = mews.twitter(cKey, cSecret)
mew = mews.twitter(token, tSecret)
mew('This is a tweet.')
```
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