id stringlengths 34 124 | type stringclasses 4
values | prompt stringlengths 0 4.95k | response stringlengths 21 4.89k | source_lang stringclasses 3
values | target_lang stringclasses 2
values | repo stringclasses 75
values | path stringlengths 10 88 | license stringclasses 1
value | commit stringlengths 40 40 | stars int64 431 18.7k | source_url stringlengths 86 176 | line_start int64 1 214 | line_end int64 3 253 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/mgmt/controller.analytics.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
/*
* Copyright (c) 2013-2015 the original author or authors.
*
* Licensed under the MIT License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/li... | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | JavaScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/mgmt/controller.analytics.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/scripts/mgmt/controller.analytics.coffee | 1 | 42 |
ExpediaGroup/cyclotron:cyclotron-site/app/scripts/mgmt/controller.analytics.coffee:1:completion | completion | ###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law ... | $scope.smallLimit = 10
$scope.largeLimit = 20
$scope.uniqueVisitorLimit = $scope.smallLimit
$scope.browserLimit = $scope.smallLimit
$scope.topDashboardsLimit = $scope.smallLimit
$scope.dataSourcesLimit = $scope.smallLimit
$scope.dataSourceTypeLimit = $scope.smallLimit
$scope.widgetTypeLimit... | CoffeeScript | CoffeeScript | ExpediaGroup/cyclotron | cyclotron-site/app/scripts/mgmt/controller.analytics.coffee | MIT | 14b0e411415be801f94fe13ea6f63d5ad957c2ed | 1,544 | https://github.com/ExpediaGroup/cyclotron/blob/14b0e411415be801f94fe13ea6f63d5ad957c2ed/cyclotron-site/app/scripts/mgmt/controller.analytics.coffee | 1 | 42 |
rs/pushd:lib/pushservices/mpns.coffee:1:raw_corpus | raw_corpus | mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^https?:\/\/[a-zA-Z0-9-.]+\.notify\.live\.net\/\S{0,500}$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger, tokenResolver) ->
@conf.type ?= "toast"
... | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 9dc56de9da2a64903cad510d22d4d0e078a8ba0a | 1,157 | https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/lib/pushservices/mpns.coffee | 1 | 50 | ||
rs/pushd:lib/pushservices/mpns.coffee:1:completion | completion | mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^https?:\/\/[a-zA-Z0-9-.]+\.notify\.live\.net\/\S{0,500}$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger, tokenResolver) ->
@conf.type ?= "toast"
... | catch e
@logger.error("Cannot compile MPNS param template: #{e}")
return
when "tile" # live tile under WP 7.5 or flip tile under WP 8.0+
map = @conf.tileMapping
properties = ["id", "title", "count", ... | CoffeeScript | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 9dc56de9da2a64903cad510d22d4d0e078a8ba0a | 1,157 | https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/lib/pushservices/mpns.coffee | 1 | 50 |
rs/pushd:lib/pushservices/mpns.coffee:2:raw_corpus | raw_corpus | note['message'] = message
note[key] = value for key, value of payload.data
# The driver only accepts payload string in raw mode
note = { payload: JSON.stringify(payload.data) }
else
@logger?.error("Unsupported MPNS notifica... | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 9dc56de9da2a64903cad510d22d4d0e078a8ba0a | 1,157 | https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/lib/pushservices/mpns.coffee | 51 | 73 | ||
rs/pushd:lib/pushservices/mpns.coffee:2:completion | completion | note['message'] = message
note[key] = value for key, value of payload.data
# The driver only accepts payload string in raw mode
note = { payload: JSON.stringify(payload.data) }
else
@logger?.error("Unsupported MPNS notifica... | if error
if error.shouldDeleteChannel
@logger?.warn("MPNS Automatic unregistration for subscriber #{subscriber.id}")
subscriber.delete()
else
@logger?.error("MPNS Error... | CoffeeScript | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 9dc56de9da2a64903cad510d22d4d0e078a8ba0a | 1,157 | https://github.com/rs/pushd/blob/9dc56de9da2a64903cad510d22d4d0e078a8ba0a/lib/pushservices/mpns.coffee | 51 | 73 |
rs/pushd:lib/pushservices/mpns.coffee:2:raw_corpus | raw_corpus | note['message'] = message
note[key] = value for key, value of payload.data
# The driver only accepts payload string in raw mode
note = { payload: JSON.stringify(payload.data) }
else
@logger?.error("Unsupported MPNS notifica... | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 571c2ea1bacb69fc35dbf8ba0962cbe79715758b | 1,157 | https://github.com/rs/pushd/blob/571c2ea1bacb69fc35dbf8ba0962cbe79715758b/lib/pushservices/mpns.coffee | 51 | 73 | ||
rs/pushd:lib/pushservices/mpns.coffee:2:completion | completion | note['message'] = message
note[key] = value for key, value of payload.data
# The driver only accepts payload string in raw mode
note = { payload: JSON.stringify(payload.data) }
else
@logger?.error("Unsupported MPNS notifica... | if error
if error.shouldDeleteChannel
@logger?.warn("MPNS Automatic unregistration for subscriber #{subscriber.id}")
subscriber.delete()
else
@logger?.error("MPNS Error... | CoffeeScript | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 571c2ea1bacb69fc35dbf8ba0962cbe79715758b | 1,157 | https://github.com/rs/pushd/blob/571c2ea1bacb69fc35dbf8ba0962cbe79715758b/lib/pushservices/mpns.coffee | 51 | 73 |
rs/pushd:lib/pushservices/mpns.coffee:2:raw_corpus | raw_corpus | note['message'] = message
note[key] = value for key, value of payload.data
# The driver only accepts payload string in raw mode
note = { payload: JSON.stringify(payload.data) }
else
@logger?.error("Unsupported MPNS notifica... | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 282b59e848260f0c45f52ef8dbe643200aaa2c36 | 1,157 | https://github.com/rs/pushd/blob/282b59e848260f0c45f52ef8dbe643200aaa2c36/lib/pushservices/mpns.coffee | 51 | 70 | ||
rs/pushd:lib/pushservices/mpns.coffee:2:completion | completion | note['message'] = message
note[key] = value for key, value of payload.data
# The driver only accepts payload string in raw mode
note = { payload: JSON.stringify(payload.data) }
else
@logger?.error("Unsupported MPNS notifica... | if error
if error.shouldDeleteChannel
@logger?.warn("MPNS Automatic unregistration for subscriber #{subscriber.id}")
subscriber.delete()
else
@logger?.error("MPNS Error: (#{error.statusCod... | CoffeeScript | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 282b59e848260f0c45f52ef8dbe643200aaa2c36 | 1,157 | https://github.com/rs/pushd/blob/282b59e848260f0c45f52ef8dbe643200aaa2c36/lib/pushservices/mpns.coffee | 51 | 70 |
rs/pushd:lib/pushservices/mpns.coffee:1:raw_corpus | raw_corpus | mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^https?:\/\/[a-zA-Z0-9-.]+\.notify\.live\.net\/\S{0,500}$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger, tokenResolver) ->
@conf.type ?= "toast"
... | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | e1baf53fd1759b76e91edcab1e93abd6d26963d1 | 1,157 | https://github.com/rs/pushd/blob/e1baf53fd1759b76e91edcab1e93abd6d26963d1/lib/pushservices/mpns.coffee | 1 | 50 | ||
rs/pushd:lib/pushservices/mpns.coffee:1:completion | completion | mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^https?:\/\/[a-zA-Z0-9-.]+\.notify\.live\.net\/\S{0,500}$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger, tokenResolver) ->
@conf.type ?= "toast"
... | catch e
@logger.error("Cannot compile MPNS param template: #{e}")
return
when "tile" # live tile under WP 7.5 or flip tile under WP 8.0+
map = @conf.tileMapping
properties = ["id", "title", "count", ... | CoffeeScript | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | e1baf53fd1759b76e91edcab1e93abd6d26963d1 | 1,157 | https://github.com/rs/pushd/blob/e1baf53fd1759b76e91edcab1e93abd6d26963d1/lib/pushservices/mpns.coffee | 1 | 50 |
rs/pushd:lib/pushservices/mpns.coffee:1:raw_corpus | raw_corpus | mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^https?:\/\/[a-zA-Z0-9-.]+\.notify\.live\.net\/\S{0,500}$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger, tokenResolver) ->
@conf.type ?= "toast"
... | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | ebd7fedbb1ee0b7f7b6ca42f76cb66a594c8980c | 1,157 | https://github.com/rs/pushd/blob/ebd7fedbb1ee0b7f7b6ca42f76cb66a594c8980c/lib/pushservices/mpns.coffee | 1 | 50 | ||
rs/pushd:lib/pushservices/mpns.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^https?:\/\/[a-zA-Z0-9-.]+\.notify\.live\.net\/\S{0,500}$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger,... | var PushServiceMPNS, mpns;
mpns = require('mpns');
PushServiceMPNS = (function() {
class PushServiceMPNS {
validateToken(token) {
if (PushServiceMPNS.prototype.tokenFormat.test(token)) {
return token;
}
}
constructor(conf, logger, tokenResolver) {
var base;
this.conf = c... | CoffeeScript | JavaScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | ebd7fedbb1ee0b7f7b6ca42f76cb66a594c8980c | 1,157 | https://github.com/rs/pushd/blob/ebd7fedbb1ee0b7f7b6ca42f76cb66a594c8980c/lib/pushservices/mpns.coffee | 1 | 50 |
rs/pushd:lib/pushservices/mpns.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var PushServiceMPNS, mpns;
mpns = require('mpns');
PushServiceMPNS = (function() {
class PushServiceMPNS {
validateToken(token) {
if (PushServiceMPNS.prototype.tokenFormat.test(token)) {
return token;
}
}
constructor(conf, logge... | mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^https?:\/\/[a-zA-Z0-9-.]+\.notify\.live\.net\/\S{0,500}$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger, tokenResolver) ->
@conf.type ?= "toast"
... | JavaScript | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | ebd7fedbb1ee0b7f7b6ca42f76cb66a594c8980c | 1,157 | https://github.com/rs/pushd/blob/ebd7fedbb1ee0b7f7b6ca42f76cb66a594c8980c/lib/pushservices/mpns.coffee | 1 | 50 |
rs/pushd:lib/pushservices/mpns.coffee:1:completion | completion | mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^https?:\/\/[a-zA-Z0-9-.]+\.notify\.live\.net\/\S{0,500}$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger, tokenResolver) ->
@conf.type ?= "toast"
... | catch e
@logger.error("Cannot compile MPNS param template: #{e}")
return
when "tile" # live tile under WP 7.5 or flip tile under WP 8.0+
map = @conf.tileMapping
properties = ["id", "title... | CoffeeScript | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | ebd7fedbb1ee0b7f7b6ca42f76cb66a594c8980c | 1,157 | https://github.com/rs/pushd/blob/ebd7fedbb1ee0b7f7b6ca42f76cb66a594c8980c/lib/pushservices/mpns.coffee | 1 | 50 |
rs/pushd:lib/pushservices/mpns.coffee:2:raw_corpus | raw_corpus | if sender
sender info.token, note, (error, result) =>
if error
if error.shouldDeleteChannel
@logger?.warn("MPNS Automatic unregistration for subscriber #{subscriber.id}")
subscriber.delete()
... | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | ebd7fedbb1ee0b7f7b6ca42f76cb66a594c8980c | 1,157 | https://github.com/rs/pushd/blob/ebd7fedbb1ee0b7f7b6ca42f76cb66a594c8980c/lib/pushservices/mpns.coffee | 51 | 63 | ||
rs/pushd:lib/pushservices/mpns.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if sender
sender info.token, note, (error, result) =>
if error
if error.shouldDeleteChannel
@logger?.warn("MPNS Automatic unregistration for subscriber #{subscriber.id}")
... | if (sender) {
sender(info.token, note, (error, result) => {
var ref, ref1, ref2;
if (error) {
if (error.shouldDeleteChannel) {
if ((ref = this.logger) != null) {
ref.warn(`MPNS Automatic unregistration for subscriber ${subscriber.id}`);
}
return subscriber.delete();
... | CoffeeScript | JavaScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | ebd7fedbb1ee0b7f7b6ca42f76cb66a594c8980c | 1,157 | https://github.com/rs/pushd/blob/ebd7fedbb1ee0b7f7b6ca42f76cb66a594c8980c/lib/pushservices/mpns.coffee | 51 | 63 |
rs/pushd:lib/pushservices/mpns.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
if (sender) {
sender(info.token, note, (error, result) => {
var ref, ref1, ref2;
if (error) {
if (error.shouldDeleteChannel) {
if ((ref = this.logger) != null) {
ref.warn(`MPNS Automatic unregistration for subscriber ${subscriber.i... | if sender
sender info.token, note, (error, result) =>
if error
if error.shouldDeleteChannel
@logger?.warn("MPNS Automatic unregistration for subscriber #{subscriber.id}")
subscriber.delete()
... | JavaScript | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | ebd7fedbb1ee0b7f7b6ca42f76cb66a594c8980c | 1,157 | https://github.com/rs/pushd/blob/ebd7fedbb1ee0b7f7b6ca42f76cb66a594c8980c/lib/pushservices/mpns.coffee | 51 | 63 |
rs/pushd:lib/pushservices/mpns.coffee:2:completion | completion | if sender
sender info.token, note, (error, result) =>
if error
if error.shouldDeleteChannel
@logger?.warn("MPNS Automatic unregistration for subscriber #{subscriber.id}")
subscriber.delete() | else
@logger?.error("MPNS Error: (#{error.statusCode}) #{error.innerError}")
else
@logger?.verbose("MPNS result: #{JSON.stringify result}")
exports.PushServiceMPNS = PushServiceMPNS | CoffeeScript | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | ebd7fedbb1ee0b7f7b6ca42f76cb66a594c8980c | 1,157 | https://github.com/rs/pushd/blob/ebd7fedbb1ee0b7f7b6ca42f76cb66a594c8980c/lib/pushservices/mpns.coffee | 51 | 63 |
rs/pushd:lib/pushservices/mpns.coffee:1:raw_corpus | raw_corpus | mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^https?:\/\/[a-zA-Z0-9-.]+\.notify\.live\.net\/\S{0,500}$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger, tokenResolver) ->
@conf.type ?= "toast"
... | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 6886fcbbe0662e23d715e2f5bd9f4e54d87c9a4a | 1,157 | https://github.com/rs/pushd/blob/6886fcbbe0662e23d715e2f5bd9f4e54d87c9a4a/lib/pushservices/mpns.coffee | 1 | 50 | ||
rs/pushd:lib/pushservices/mpns.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^https?:\/\/[a-zA-Z0-9-.]+\.notify\.live\.net\/\S{0,500}$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger,... | var PushServiceMPNS, mpns;
mpns = require('mpns');
PushServiceMPNS = (function() {
class PushServiceMPNS {
validateToken(token) {
if (PushServiceMPNS.prototype.tokenFormat.test(token)) {
return token;
}
}
constructor(conf, logger, tokenResolver) {
var base;
this.conf = c... | CoffeeScript | JavaScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 6886fcbbe0662e23d715e2f5bd9f4e54d87c9a4a | 1,157 | https://github.com/rs/pushd/blob/6886fcbbe0662e23d715e2f5bd9f4e54d87c9a4a/lib/pushservices/mpns.coffee | 1 | 50 |
rs/pushd:lib/pushservices/mpns.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var PushServiceMPNS, mpns;
mpns = require('mpns');
PushServiceMPNS = (function() {
class PushServiceMPNS {
validateToken(token) {
if (PushServiceMPNS.prototype.tokenFormat.test(token)) {
return token;
}
}
constructor(conf, logge... | mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^https?:\/\/[a-zA-Z0-9-.]+\.notify\.live\.net\/\S{0,500}$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger, tokenResolver) ->
@conf.type ?= "toast"
... | JavaScript | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 6886fcbbe0662e23d715e2f5bd9f4e54d87c9a4a | 1,157 | https://github.com/rs/pushd/blob/6886fcbbe0662e23d715e2f5bd9f4e54d87c9a4a/lib/pushservices/mpns.coffee | 1 | 50 |
rs/pushd:lib/pushservices/mpns.coffee:1:completion | completion | mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^https?:\/\/[a-zA-Z0-9-.]+\.notify\.live\.net\/\S{0,500}$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger, tokenResolver) ->
@conf.type ?= "toast"
... | catch e
@logger.error("Cannot compile MPNS param template: #{e}")
return
when "tile" # live tile under WP 7.5 or flip tile under WP 8.0+
map = @conf.tileMapping
properties = ["id", "title... | CoffeeScript | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 6886fcbbe0662e23d715e2f5bd9f4e54d87c9a4a | 1,157 | https://github.com/rs/pushd/blob/6886fcbbe0662e23d715e2f5bd9f4e54d87c9a4a/lib/pushservices/mpns.coffee | 1 | 50 |
rs/pushd:lib/pushservices/mpns.coffee:2:raw_corpus | raw_corpus | if note
note.send info.token, (error, result) =>
console.log [error, result]
if error
if error.shouldDeleteChannel
@logger?.warn("MPNS Automatic unregistration for subscriber #{subscriber.id}")
... | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 6886fcbbe0662e23d715e2f5bd9f4e54d87c9a4a | 1,157 | https://github.com/rs/pushd/blob/6886fcbbe0662e23d715e2f5bd9f4e54d87c9a4a/lib/pushservices/mpns.coffee | 51 | 62 | ||
rs/pushd:lib/pushservices/mpns.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if note
note.send info.token, (error, result) =>
console.log [error, result]
if error
if error.shouldDeleteChannel
@logger?.warn("MPNS Automatic unregistra... | if (note) {
note.send(info.token, (error, result) => {
var ref, ref1;
console.log([error, result]);
if (error) {
if (error.shouldDeleteChannel) {
if ((ref = this.logger) != null) {
ref.warn(`MPNS Automatic unregistration for subscriber ${subscriber.id}`);
}
return s... | CoffeeScript | JavaScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 6886fcbbe0662e23d715e2f5bd9f4e54d87c9a4a | 1,157 | https://github.com/rs/pushd/blob/6886fcbbe0662e23d715e2f5bd9f4e54d87c9a4a/lib/pushservices/mpns.coffee | 51 | 62 |
rs/pushd:lib/pushservices/mpns.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
if (note) {
note.send(info.token, (error, result) => {
var ref, ref1;
console.log([error, result]);
if (error) {
if (error.shouldDeleteChannel) {
if ((ref = this.logger) != null) {
ref.warn(`MPNS Automatic unregistration for su... | if note
note.send info.token, (error, result) =>
console.log [error, result]
if error
if error.shouldDeleteChannel
@logger?.warn("MPNS Automatic unregistration for subscriber #{subscriber.id}")
... | JavaScript | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 6886fcbbe0662e23d715e2f5bd9f4e54d87c9a4a | 1,157 | https://github.com/rs/pushd/blob/6886fcbbe0662e23d715e2f5bd9f4e54d87c9a4a/lib/pushservices/mpns.coffee | 51 | 62 |
rs/pushd:lib/pushservices/mpns.coffee:2:completion | completion | if note
note.send info.token, (error, result) =>
console.log [error, result]
if error
if error.shouldDeleteChannel
@logger?.warn("MPNS Automatic unregistration for subscriber #{subscriber.id}") | subscriber.delete()
else
@logger?.error("MPNS Error: (#{error.statusCode}) #{error.innerError}")
exports.PushServiceMPNS = PushServiceMPNS | CoffeeScript | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 6886fcbbe0662e23d715e2f5bd9f4e54d87c9a4a | 1,157 | https://github.com/rs/pushd/blob/6886fcbbe0662e23d715e2f5bd9f4e54d87c9a4a/lib/pushservices/mpns.coffee | 51 | 62 |
rs/pushd:lib/pushservices/mpns.coffee:1:raw_corpus | raw_corpus | mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^https?:\/\/[a-zA-Z0-9-.]+\.notify\.live\.net\/\S{0,500}$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger, tokenResolver) ->
@conf.type ?= "toast"
... | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 19a26cb8962a4d1a2a8aebd7ac06fcd581b23223 | 1,157 | https://github.com/rs/pushd/blob/19a26cb8962a4d1a2a8aebd7ac06fcd581b23223/lib/pushservices/mpns.coffee | 1 | 50 | ||
rs/pushd:lib/pushservices/mpns.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^https?:\/\/[a-zA-Z0-9-.]+\.notify\.live\.net\/\S{0,500}$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger,... | var PushServiceMPNS, mpns;
mpns = require('mpns');
PushServiceMPNS = (function() {
class PushServiceMPNS {
validateToken(token) {
if (PushServiceMPNS.prototype.tokenFormat.test(token)) {
return token;
}
}
constructor(conf, logger, tokenResolver) {
var base;
this.conf = c... | CoffeeScript | JavaScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 19a26cb8962a4d1a2a8aebd7ac06fcd581b23223 | 1,157 | https://github.com/rs/pushd/blob/19a26cb8962a4d1a2a8aebd7ac06fcd581b23223/lib/pushservices/mpns.coffee | 1 | 50 |
rs/pushd:lib/pushservices/mpns.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var PushServiceMPNS, mpns;
mpns = require('mpns');
PushServiceMPNS = (function() {
class PushServiceMPNS {
validateToken(token) {
if (PushServiceMPNS.prototype.tokenFormat.test(token)) {
return token;
}
}
constructor(conf, logge... | mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^https?:\/\/[a-zA-Z0-9-.]+\.notify\.live\.net\/\S{0,500}$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger, tokenResolver) ->
@conf.type ?= "toast"
... | JavaScript | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 19a26cb8962a4d1a2a8aebd7ac06fcd581b23223 | 1,157 | https://github.com/rs/pushd/blob/19a26cb8962a4d1a2a8aebd7ac06fcd581b23223/lib/pushservices/mpns.coffee | 1 | 50 |
rs/pushd:lib/pushservices/mpns.coffee:1:completion | completion | mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^https?:\/\/[a-zA-Z0-9-.]+\.notify\.live\.net\/\S{0,500}$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger, tokenResolver) ->
@conf.type ?= "toast"
... | catch e
@logger.error("Cannot compile MPNS param template: #{e}")
return
when "tile" # live tile under WP 7.5 or flip tile under WP 8.0+
map = @conf.tileMapping
properties = ["id", "title... | CoffeeScript | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 19a26cb8962a4d1a2a8aebd7ac06fcd581b23223 | 1,157 | https://github.com/rs/pushd/blob/19a26cb8962a4d1a2a8aebd7ac06fcd581b23223/lib/pushservices/mpns.coffee | 1 | 50 |
rs/pushd:lib/pushservices/mpns.coffee:1:raw_corpus | raw_corpus | mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^https?:\/\/[a-zA-Z0-9-.]+\.notify\.live\.net\/\S{0,500}$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger, tokenResolver) ->
@conf.type ?= "toast"
... | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 74790d89fcac886e630e737f4ccfd5c6b3225cba | 1,157 | https://github.com/rs/pushd/blob/74790d89fcac886e630e737f4ccfd5c6b3225cba/lib/pushservices/mpns.coffee | 1 | 50 | ||
rs/pushd:lib/pushservices/mpns.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^https?:\/\/[a-zA-Z0-9-.]+\.notify\.live\.net\/\S{0,500}$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger,... | var PushServiceMPNS, mpns;
mpns = require('mpns');
PushServiceMPNS = (function() {
class PushServiceMPNS {
validateToken(token) {
if (PushServiceMPNS.prototype.tokenFormat.test(token)) {
return token;
}
}
constructor(conf, logger, tokenResolver) {
var base;
this.conf = c... | CoffeeScript | JavaScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 74790d89fcac886e630e737f4ccfd5c6b3225cba | 1,157 | https://github.com/rs/pushd/blob/74790d89fcac886e630e737f4ccfd5c6b3225cba/lib/pushservices/mpns.coffee | 1 | 50 |
rs/pushd:lib/pushservices/mpns.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var PushServiceMPNS, mpns;
mpns = require('mpns');
PushServiceMPNS = (function() {
class PushServiceMPNS {
validateToken(token) {
if (PushServiceMPNS.prototype.tokenFormat.test(token)) {
return token;
}
}
constructor(conf, logge... | mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^https?:\/\/[a-zA-Z0-9-.]+\.notify\.live\.net\/\S{0,500}$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger, tokenResolver) ->
@conf.type ?= "toast"
... | JavaScript | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 74790d89fcac886e630e737f4ccfd5c6b3225cba | 1,157 | https://github.com/rs/pushd/blob/74790d89fcac886e630e737f4ccfd5c6b3225cba/lib/pushservices/mpns.coffee | 1 | 50 |
rs/pushd:lib/pushservices/mpns.coffee:1:completion | completion | mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^https?:\/\/[a-zA-Z0-9-.]+\.notify\.live\.net\/\S{0,500}$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger, tokenResolver) ->
@conf.type ?= "toast"
... | catch e
@logger.error("Cannot compile MPNS param template: #{e}")
return
when "tile" # live tile under WP 7.5 or flip tile under WP 8.0+
map = @conf.tileMapping
properties = ["id", "title... | CoffeeScript | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 74790d89fcac886e630e737f4ccfd5c6b3225cba | 1,157 | https://github.com/rs/pushd/blob/74790d89fcac886e630e737f4ccfd5c6b3225cba/lib/pushservices/mpns.coffee | 1 | 50 |
rs/pushd:lib/pushservices/mpns.coffee:1:raw_corpus | raw_corpus | mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^https?:\/\/\S{0,500}$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger, tokenResolver) ->
@conf.type ?= "toast"
if @conf.type is "tile" and not @co... | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | a9304020e2959a2734599b31a9c4d67db2c76b66 | 1,157 | https://github.com/rs/pushd/blob/a9304020e2959a2734599b31a9c4d67db2c76b66/lib/pushservices/mpns.coffee | 1 | 50 | ||
rs/pushd:lib/pushservices/mpns.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^https?:\/\/\S{0,500}$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger, tokenResolver) ->
@conf.ty... | var PushServiceMPNS, mpns;
mpns = require('mpns');
PushServiceMPNS = (function() {
class PushServiceMPNS {
validateToken(token) {
if (PushServiceMPNS.prototype.tokenFormat.test(token)) {
return token;
}
}
constructor(conf, logger, tokenResolver) {
var base;
this.conf = c... | CoffeeScript | JavaScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | a9304020e2959a2734599b31a9c4d67db2c76b66 | 1,157 | https://github.com/rs/pushd/blob/a9304020e2959a2734599b31a9c4d67db2c76b66/lib/pushservices/mpns.coffee | 1 | 50 |
rs/pushd:lib/pushservices/mpns.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var PushServiceMPNS, mpns;
mpns = require('mpns');
PushServiceMPNS = (function() {
class PushServiceMPNS {
validateToken(token) {
if (PushServiceMPNS.prototype.tokenFormat.test(token)) {
return token;
}
}
constructor(conf, logge... | mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^https?:\/\/\S{0,500}$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger, tokenResolver) ->
@conf.type ?= "toast"
if @conf.type is "tile" and not @co... | JavaScript | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | a9304020e2959a2734599b31a9c4d67db2c76b66 | 1,157 | https://github.com/rs/pushd/blob/a9304020e2959a2734599b31a9c4d67db2c76b66/lib/pushservices/mpns.coffee | 1 | 50 |
rs/pushd:lib/pushservices/mpns.coffee:1:completion | completion | mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^https?:\/\/\S{0,500}$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger, tokenResolver) ->
@conf.type ?= "toast"
if @conf.type is "tile" and not @co... | catch e
@logger.error("Cannot compile MPNS param template: #{e}")
return
when "tile" # live tile under WP 7.5 or flip tile under WP 8.0+
map = @conf.tileMapping
properties = ["id", "title... | CoffeeScript | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | a9304020e2959a2734599b31a9c4d67db2c76b66 | 1,157 | https://github.com/rs/pushd/blob/a9304020e2959a2734599b31a9c4d67db2c76b66/lib/pushservices/mpns.coffee | 1 | 50 |
rs/pushd:lib/pushservices/mpns.coffee:2:raw_corpus | raw_corpus | if note
note.send info.token, (error, result) =>
if error
if error.shouldDeleteChannel
@logger?.warn("MPNS Automatic unregistration for subscriber #{subscriber.id}")
subscriber.delete()
... | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | a9304020e2959a2734599b31a9c4d67db2c76b66 | 1,157 | https://github.com/rs/pushd/blob/a9304020e2959a2734599b31a9c4d67db2c76b66/lib/pushservices/mpns.coffee | 51 | 61 | ||
rs/pushd:lib/pushservices/mpns.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
if note
note.send info.token, (error, result) =>
if error
if error.shouldDeleteChannel
@logger?.warn("MPNS Automatic unregistration for subscriber #{subscriber.id}")
... | if (note) {
note.send(info.token, (error, result) => {
var ref, ref1;
if (error) {
if (error.shouldDeleteChannel) {
if ((ref = this.logger) != null) {
ref.warn(`MPNS Automatic unregistration for subscriber ${subscriber.id}`);
}
return subscriber.delete();
} else {... | CoffeeScript | JavaScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | a9304020e2959a2734599b31a9c4d67db2c76b66 | 1,157 | https://github.com/rs/pushd/blob/a9304020e2959a2734599b31a9c4d67db2c76b66/lib/pushservices/mpns.coffee | 51 | 61 |
rs/pushd:lib/pushservices/mpns.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
if (note) {
note.send(info.token, (error, result) => {
var ref, ref1;
if (error) {
if (error.shouldDeleteChannel) {
if ((ref = this.logger) != null) {
ref.warn(`MPNS Automatic unregistration for subscriber ${subscriber.id}`);
... | if note
note.send info.token, (error, result) =>
if error
if error.shouldDeleteChannel
@logger?.warn("MPNS Automatic unregistration for subscriber #{subscriber.id}")
subscriber.delete()
... | JavaScript | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | a9304020e2959a2734599b31a9c4d67db2c76b66 | 1,157 | https://github.com/rs/pushd/blob/a9304020e2959a2734599b31a9c4d67db2c76b66/lib/pushservices/mpns.coffee | 51 | 61 |
rs/pushd:lib/pushservices/mpns.coffee:2:completion | completion | if note
note.send info.token, (error, result) =>
if error
if error.shouldDeleteChannel
@logger?.warn("MPNS Automatic unregistration for subscriber #{subscriber.id}") | subscriber.delete()
else
@logger?.error("MPNS Error: (#{error.statusCode}) #{error.innerError}")
exports.PushServiceMPNS = PushServiceMPNS | CoffeeScript | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | a9304020e2959a2734599b31a9c4d67db2c76b66 | 1,157 | https://github.com/rs/pushd/blob/a9304020e2959a2734599b31a9c4d67db2c76b66/lib/pushservices/mpns.coffee | 51 | 61 |
rs/pushd:lib/pushservices/mpns.coffee:1:raw_corpus | raw_corpus | mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^https?:\/\/\S{0,500}$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger, tokenResolver) ->
@conf.type ?= "toast"
if @conf.type is "tile" and not @co... | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | e06c0068c21e877e2f2e3b1e132159c21819f0ca | 1,157 | https://github.com/rs/pushd/blob/e06c0068c21e877e2f2e3b1e132159c21819f0ca/lib/pushservices/mpns.coffee | 1 | 50 | ||
rs/pushd:lib/pushservices/mpns.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^https?:\/\/\S{0,500}$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger, tokenResolver) ->
@conf.ty... | var PushServiceMPNS, mpns;
mpns = require('mpns');
PushServiceMPNS = (function() {
class PushServiceMPNS {
validateToken(token) {
if (PushServiceMPNS.prototype.tokenFormat.test(token)) {
return token;
}
}
constructor(conf, logger, tokenResolver) {
var base;
this.conf = c... | CoffeeScript | JavaScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | e06c0068c21e877e2f2e3b1e132159c21819f0ca | 1,157 | https://github.com/rs/pushd/blob/e06c0068c21e877e2f2e3b1e132159c21819f0ca/lib/pushservices/mpns.coffee | 1 | 50 |
rs/pushd:lib/pushservices/mpns.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var PushServiceMPNS, mpns;
mpns = require('mpns');
PushServiceMPNS = (function() {
class PushServiceMPNS {
validateToken(token) {
if (PushServiceMPNS.prototype.tokenFormat.test(token)) {
return token;
}
}
constructor(conf, logge... | mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^https?:\/\/\S{0,500}$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger, tokenResolver) ->
@conf.type ?= "toast"
if @conf.type is "tile" and not @co... | JavaScript | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | e06c0068c21e877e2f2e3b1e132159c21819f0ca | 1,157 | https://github.com/rs/pushd/blob/e06c0068c21e877e2f2e3b1e132159c21819f0ca/lib/pushservices/mpns.coffee | 1 | 50 |
rs/pushd:lib/pushservices/mpns.coffee:1:completion | completion | mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^https?:\/\/\S{0,500}$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger, tokenResolver) ->
@conf.type ?= "toast"
if @conf.type is "tile" and not @co... | catch e
@logger.error("Cannot compile MPNS param template: #{e}")
return
when "tile" # live tile under WP 7.5 or flip tile under WP 8.0+
map = @conf.tileMapping
properties = ["title", "ba... | CoffeeScript | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | e06c0068c21e877e2f2e3b1e132159c21819f0ca | 1,157 | https://github.com/rs/pushd/blob/e06c0068c21e877e2f2e3b1e132159c21819f0ca/lib/pushservices/mpns.coffee | 1 | 50 |
rs/pushd:lib/pushservices/mpns.coffee:1:raw_corpus | raw_corpus | mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^https?:\/\/\S{0,500}$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger, tokenResolver) ->
@conf.type ?= "toast"
if @conf.type is "tile" and not @co... | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 2bafef27e4658d71a27d03307392dd35c6f3bfdd | 1,157 | https://github.com/rs/pushd/blob/2bafef27e4658d71a27d03307392dd35c6f3bfdd/lib/pushservices/mpns.coffee | 1 | 50 | ||
rs/pushd:lib/pushservices/mpns.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^https?:\/\/\S{0,500}$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger, tokenResolver) ->
@conf.ty... | var PushServiceMPNS, mpns;
mpns = require('mpns');
PushServiceMPNS = (function() {
class PushServiceMPNS {
validateToken(token) {
if (PushServiceMPNS.prototype.tokenFormat.test(token)) {
return token;
}
}
constructor(conf, logger, tokenResolver) {
var base;
this.conf = c... | CoffeeScript | JavaScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 2bafef27e4658d71a27d03307392dd35c6f3bfdd | 1,157 | https://github.com/rs/pushd/blob/2bafef27e4658d71a27d03307392dd35c6f3bfdd/lib/pushservices/mpns.coffee | 1 | 50 |
rs/pushd:lib/pushservices/mpns.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var PushServiceMPNS, mpns;
mpns = require('mpns');
PushServiceMPNS = (function() {
class PushServiceMPNS {
validateToken(token) {
if (PushServiceMPNS.prototype.tokenFormat.test(token)) {
return token;
}
}
constructor(conf, logge... | mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^https?:\/\/\S{0,500}$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger, tokenResolver) ->
@conf.type ?= "toast"
if @conf.type is "tile" and not @co... | JavaScript | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 2bafef27e4658d71a27d03307392dd35c6f3bfdd | 1,157 | https://github.com/rs/pushd/blob/2bafef27e4658d71a27d03307392dd35c6f3bfdd/lib/pushservices/mpns.coffee | 1 | 50 |
rs/pushd:lib/pushservices/mpns.coffee:1:completion | completion | mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^https?:\/\/\S{0,500}$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger, tokenResolver) ->
@conf.type ?= "toast"
if @conf.type is "tile" and not @co... | catch e
@logger.error("Cannot compile MPNS param template: #{e}")
return
when "tile" # live tile under WP 7.5 or flip tile under WP 8.0+
map = @conf.tileMapping
properties = ["title", "ba... | CoffeeScript | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 2bafef27e4658d71a27d03307392dd35c6f3bfdd | 1,157 | https://github.com/rs/pushd/blob/2bafef27e4658d71a27d03307392dd35c6f3bfdd/lib/pushservices/mpns.coffee | 1 | 50 |
rs/pushd:lib/pushservices/mpns.coffee:1:raw_corpus | raw_corpus | mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^[a-zA-Z0-9_-]+$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger, tokenResolver) ->
push: (subscriber, subOptions, payload) ->
# TO BE IMPLEMENTED
ex... | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 7ceb220702d1a84dfe235ee2be0329783f1e6f19 | 1,157 | https://github.com/rs/pushd/blob/7ceb220702d1a84dfe235ee2be0329783f1e6f19/lib/pushservices/mpns.coffee | 1 | 14 | ||
rs/pushd:lib/pushservices/mpns.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^[a-zA-Z0-9_-]+$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger, tokenResolver) ->
push: (subscriber... | var PushServiceMPNS, mpns;
mpns = require('mpns');
PushServiceMPNS = (function() {
class PushServiceMPNS {
validateToken(token) {
if (PushServiceMPNS.prototype.tokenFormat.test(token)) {
return token;
}
}
constructor(conf, logger, tokenResolver) {
this.conf = conf;
this.... | CoffeeScript | JavaScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 7ceb220702d1a84dfe235ee2be0329783f1e6f19 | 1,157 | https://github.com/rs/pushd/blob/7ceb220702d1a84dfe235ee2be0329783f1e6f19/lib/pushservices/mpns.coffee | 1 | 14 |
rs/pushd:lib/pushservices/mpns.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var PushServiceMPNS, mpns;
mpns = require('mpns');
PushServiceMPNS = (function() {
class PushServiceMPNS {
validateToken(token) {
if (PushServiceMPNS.prototype.tokenFormat.test(token)) {
return token;
}
}
constructor(conf, logge... | mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^[a-zA-Z0-9_-]+$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger, tokenResolver) ->
push: (subscriber, subOptions, payload) ->
# TO BE IMPLEMENTED
ex... | JavaScript | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 7ceb220702d1a84dfe235ee2be0329783f1e6f19 | 1,157 | https://github.com/rs/pushd/blob/7ceb220702d1a84dfe235ee2be0329783f1e6f19/lib/pushservices/mpns.coffee | 1 | 14 |
rs/pushd:lib/pushservices/mpns.coffee:1:completion | completion | mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^[a-zA-Z0-9_-]+$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token | constructor: (@conf, @logger, tokenResolver) ->
push: (subscriber, subOptions, payload) ->
# TO BE IMPLEMENTED
exports.PushServiceMPNS = PushServiceMPNS | CoffeeScript | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 7ceb220702d1a84dfe235ee2be0329783f1e6f19 | 1,157 | https://github.com/rs/pushd/blob/7ceb220702d1a84dfe235ee2be0329783f1e6f19/lib/pushservices/mpns.coffee | 1 | 14 |
rs/pushd:lib/pushservices/mpns.coffee:1:raw_corpus | raw_corpus | mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^[a-zA-Z0-9_-]+$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger) ->
push: (subscriber, subOptions, payload) ->
# TO BE IMPLEMENTED
exports.PushServi... | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 417ef78179f801cee98cf039b2bdcaac9096b7f7 | 1,157 | https://github.com/rs/pushd/blob/417ef78179f801cee98cf039b2bdcaac9096b7f7/lib/pushservices/mpns.coffee | 1 | 14 | ||
rs/pushd:lib/pushservices/mpns.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^[a-zA-Z0-9_-]+$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger) ->
push: (subscriber, subOptions, p... | var PushServiceMPNS, mpns;
mpns = require('mpns');
PushServiceMPNS = (function() {
class PushServiceMPNS {
validateToken(token) {
if (PushServiceMPNS.prototype.tokenFormat.test(token)) {
return token;
}
}
constructor(conf, logger) {
this.conf = conf;
this.logger = logger... | CoffeeScript | JavaScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 417ef78179f801cee98cf039b2bdcaac9096b7f7 | 1,157 | https://github.com/rs/pushd/blob/417ef78179f801cee98cf039b2bdcaac9096b7f7/lib/pushservices/mpns.coffee | 1 | 14 |
rs/pushd:lib/pushservices/mpns.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var PushServiceMPNS, mpns;
mpns = require('mpns');
PushServiceMPNS = (function() {
class PushServiceMPNS {
validateToken(token) {
if (PushServiceMPNS.prototype.tokenFormat.test(token)) {
return token;
}
}
constructor(conf, logge... | mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^[a-zA-Z0-9_-]+$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token
constructor: (@conf, @logger) ->
push: (subscriber, subOptions, payload) ->
# TO BE IMPLEMENTED
exports.PushServi... | JavaScript | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 417ef78179f801cee98cf039b2bdcaac9096b7f7 | 1,157 | https://github.com/rs/pushd/blob/417ef78179f801cee98cf039b2bdcaac9096b7f7/lib/pushservices/mpns.coffee | 1 | 14 |
rs/pushd:lib/pushservices/mpns.coffee:1:completion | completion | mpns = require 'mpns'
class PushServiceMPNS
tokenFormat: /^[a-zA-Z0-9_-]+$/
validateToken: (token) ->
if PushServiceMPNS::tokenFormat.test(token)
return token | constructor: (@conf, @logger) ->
push: (subscriber, subOptions, payload) ->
# TO BE IMPLEMENTED
exports.PushServiceMPNS = PushServiceMPNS | CoffeeScript | CoffeeScript | rs/pushd | lib/pushservices/mpns.coffee | MIT | 417ef78179f801cee98cf039b2bdcaac9096b7f7 | 1,157 | https://github.com/rs/pushd/blob/417ef78179f801cee98cf039b2bdcaac9096b7f7/lib/pushservices/mpns.coffee | 1 | 14 |
jianliaoim/talk-os:talk-api2x/server/config/locales/zh.coffee:1:raw_corpus | raw_corpus | module.exports =
DEFAULT_ERROR: '未知错误'
CREATE_ERROR: (collection) -> "数据创建错误: #{collection}"
UPDATE_ERROR: (collection) -> "数据更新错误: #{collection}"
DELETE_ERROR: (collection) -> "数据删除错误: #{collection}"
NOT_LOGIN: '用户未登录'
INVALID_TOKEN: 'Token 错误,请重新登录'
MISSING_UID: '缺少uid'
MEMBER_CHECK_FAIL: (type) -> "... | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/config/locales/zh.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/config/locales/zh.coffee | 1 | 50 | ||
jianliaoim/talk-os:talk-api2x/server/config/locales/zh.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports =
DEFAULT_ERROR: '未知错误'
CREATE_ERROR: (collection) -> "数据创建错误: #{collection}"
UPDATE_ERROR: (collection) -> "数据更新错误: #{collection}"
DELETE_ERROR: (collection) -> "数据删除错误: #{collection}"
NOT_LOGIN: '用户未登录'
INVALID_TOKEN: 'Token 错误,请重新登录... | module.exports = {
DEFAULT_ERROR: '未知错误',
CREATE_ERROR: function(collection) {
return `数据创建错误: ${collection}`;
},
UPDATE_ERROR: function(collection) {
return `数据更新错误: ${collection}`;
},
DELETE_ERROR: function(collection) {
return `数据删除错误: ${collection}`;
},
NOT_LOGIN: '用户未登录',
INVALID_TOKE... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-api2x/server/config/locales/zh.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/config/locales/zh.coffee | 1 | 50 |
jianliaoim/talk-os:talk-api2x/server/config/locales/zh.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = {
DEFAULT_ERROR: '未知错误',
CREATE_ERROR: function(collection) {
return `数据创建错误: ${collection}`;
},
UPDATE_ERROR: function(collection) {
return `数据更新错误: ${collection}`;
},
DELETE_ERROR: function(collection) {
return `数据删除错误: ${... | module.exports =
DEFAULT_ERROR: '未知错误'
CREATE_ERROR: (collection) -> "数据创建错误: #{collection}"
UPDATE_ERROR: (collection) -> "数据更新错误: #{collection}"
DELETE_ERROR: (collection) -> "数据删除错误: #{collection}"
NOT_LOGIN: '用户未登录'
INVALID_TOKEN: 'Token 错误,请重新登录'
MISSING_UID: '缺少uid'
MEMBER_CHECK_FAIL: (type) -> "... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/config/locales/zh.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/config/locales/zh.coffee | 1 | 50 |
jianliaoim/talk-os:talk-api2x/server/config/locales/zh.coffee:1:completion | completion | module.exports =
DEFAULT_ERROR: '未知错误'
CREATE_ERROR: (collection) -> "数据创建错误: #{collection}"
UPDATE_ERROR: (collection) -> "数据更新错误: #{collection}"
DELETE_ERROR: (collection) -> "数据删除错误: #{collection}"
NOT_LOGIN: '用户未登录'
INVALID_TOKEN: 'Token 错误,请重新登录'
MISSING_UID: '缺少uid'
MEMBER_CHECK_FAIL: (type) -> "... | INVALID_OBJECT: (args...) -> "错误的对象: #{args.join(', ')}"
NO_PERMISSION: '无访问权限'
TOKEN_EXPIRED: '你的登录已过期,请重新登录'
NOT_EDITABLE: (fields...) -> "以下属性不可编辑:#{fields.join(', ')}"
ROOM_IS_ARCHIVED: "话题已被归档"
SIGNATURE_FAILED: "签名校验错误"
REQUEST_FAILD: "请求失败"
NOT_ACCESSIBLE_FOR_GUEST: "无访客权限"
FILE_SAVE_FAILED: "保存文... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/config/locales/zh.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/config/locales/zh.coffee | 1 | 50 |
jianliaoim/talk-os:talk-api2x/server/config/locales/zh.coffee:2:raw_corpus | raw_corpus | INVALID_REFER: "错误的同步来源"
PUSH_FAILED: "消息推送失败 %s"
INVALID_MAKR_TARGET: "此对象不可标记"
NAME_CONFLICT: "该名称已存在"
CAN_NOT_ADD_INTEGRATION_IN_OFFICIAL_ROOMS: "这是一个公开的团队,请勿在此添加聚合服务"
INTEGRATION_ERROR: '聚合数据出现错误: %s'
INTEGRATION_ERROR_DISABLED: '你的聚合服务因为错误次数过多而被停用,如需重新启用,请修改服务配置。错误信息:%s'
MOBILE_RATE_EXCEEDED: "发送短信次数... | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/config/locales/zh.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/config/locales/zh.coffee | 51 | 100 | ||
jianliaoim/talk-os:talk-api2x/server/config/locales/zh.coffee:2:completion | completion | INVALID_REFER: "错误的同步来源"
PUSH_FAILED: "消息推送失败 %s"
INVALID_MAKR_TARGET: "此对象不可标记"
NAME_CONFLICT: "该名称已存在"
CAN_NOT_ADD_INTEGRATION_IN_OFFICIAL_ROOMS: "这是一个公开的团队,请勿在此添加聚合服务"
INTEGRATION_ERROR: '聚合数据出现错误: %s'
INTEGRATION_ERROR_DISABLED: '你的聚合服务因为错误次数过多而被停用,如需重新启用,请修改服务配置。错误信息:%s'
MOBILE_RATE_EXCEEDED: "发送短信次数... | MESSAGE_STRUCTURE_ERROR: "消息结构错误"
INVALID_SERVICE: "不存在的聚合类型"
INVALID_RSS_URL: "不是有效的 RSS 链接"
########################## Define functions ##########################
inteErrorMessage: (integration, topic = '') ->
"""
聚合内容出现错误,请查看后重新配置。
聚合类型:#{integration.category}
错误信息:#{integration.errorInfo}
... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/config/locales/zh.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/config/locales/zh.coffee | 51 | 100 |
jianliaoim/talk-os:talk-api2x/server/config/locales/zh.coffee:3:raw_corpus | raw_corpus | msg = "你好,欢迎加入#{team.name},在这里你可以与团队成员分享文件,想法和链接,并在不同的话题中参与讨论,「简聊」起来吧。"
msg += "\n" + team.description if team.description?.length
msg | CoffeeScript | jianliaoim/talk-os | talk-api2x/server/config/locales/zh.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/server/config/locales/zh.coffee | 101 | 103 | ||
xhan/qqbot:src/qqapi.coffee:1:raw_corpus | raw_corpus | exports.cookies = (cookie)->
if cookie
all_cookies = cookie
client.global_cookies(all_cookies)
return all_cookies
# 长轮询,默认一分钟
# @param : [clientid,psessionid]
# @param callback: ret, e
# @return ret retcode 102,正常空消息 | CoffeeScript | xhan/qqbot | src/qqapi.coffee | MIT | 917291c872151d823d9d926aa39d2fdb97215e78 | 1,435 | https://github.com/xhan/qqbot/blob/917291c872151d823d9d926aa39d2fdb97215e78/src/qqapi.coffee | 14 | 24 | ||
xhan/qqbot:src/qqapi.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.cookies = (cookie)->
if cookie
all_cookies = cookie
client.global_cookies(all_cookies)
return all_cookies
# 长轮询,默认一分钟
# @param : [clientid,psessionid]
# @param callback: ret, e
# @return ret retcode 102,正常空消息
``` | exports.cookies = function(cookie) {
var all_cookies;
if (cookie) {
all_cookies = cookie;
client.global_cookies(all_cookies);
}
return all_cookies;
};
// 长轮询,默认一分钟
// @param : [clientid,psessionid]
// @param callback: ret, e
// @return ret retcode 102,正常空消息 | CoffeeScript | JavaScript | xhan/qqbot | src/qqapi.coffee | MIT | 917291c872151d823d9d926aa39d2fdb97215e78 | 1,435 | https://github.com/xhan/qqbot/blob/917291c872151d823d9d926aa39d2fdb97215e78/src/qqapi.coffee | 14 | 24 |
xhan/qqbot:src/qqapi.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.cookies = function(cookie) {
var all_cookies;
if (cookie) {
all_cookies = cookie;
client.global_cookies(all_cookies);
}
return all_cookies;
};
// 长轮询,默认一分钟
// @param : [clientid,psessionid]
// @param callback: ret, e
// @return ret retco... | exports.cookies = (cookie)->
if cookie
all_cookies = cookie
client.global_cookies(all_cookies)
return all_cookies
# 长轮询,默认一分钟
# @param : [clientid,psessionid]
# @param callback: ret, e
# @return ret retcode 102,正常空消息 | JavaScript | CoffeeScript | xhan/qqbot | src/qqapi.coffee | MIT | 917291c872151d823d9d926aa39d2fdb97215e78 | 1,435 | https://github.com/xhan/qqbot/blob/917291c872151d823d9d926aa39d2fdb97215e78/src/qqapi.coffee | 14 | 24 |
xhan/qqbot:src/qqapi.coffee:2:raw_corpus | raw_corpus | long_poll = (auth_opts, callback) ->
log.debug "polling..."
[clientid, psessionid] = [auth_opts.clientid, auth_opts.psessionid]
url = "http://d.web2.qq.com/channel/poll2"
r =
clientid: "#{clientid}"
psessionid: psessionid
key:0
ids:[]
params =
clientid: client... | CoffeeScript | xhan/qqbot | src/qqapi.coffee | MIT | 917291c872151d823d9d926aa39d2fdb97215e78 | 1,435 | https://github.com/xhan/qqbot/blob/917291c872151d823d9d926aa39d2fdb97215e78/src/qqapi.coffee | 25 | 71 | ||
xhan/qqbot:src/qqapi.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
long_poll = (auth_opts, callback) ->
log.debug "polling..."
[clientid, psessionid] = [auth_opts.clientid, auth_opts.psessionid]
url = "http://d.web2.qq.com/channel/poll2"
r =
clientid: "#{clientid}"
psessionid: psessionid
k... | var hash_func, long_poll;
long_poll = function(auth_opts, callback) {
var clientid, params, psessionid, r, url;
log.debug("polling...");
[clientid, psessionid] = [auth_opts.clientid, auth_opts.psessionid];
url = "http://d.web2.qq.com/channel/poll2";
r = {
clientid: `${clientid}`,
psessionid: psession... | CoffeeScript | JavaScript | xhan/qqbot | src/qqapi.coffee | MIT | 917291c872151d823d9d926aa39d2fdb97215e78 | 1,435 | https://github.com/xhan/qqbot/blob/917291c872151d823d9d926aa39d2fdb97215e78/src/qqapi.coffee | 25 | 71 |
xhan/qqbot:src/qqapi.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var hash_func, long_poll;
long_poll = function(auth_opts, callback) {
var clientid, params, psessionid, r, url;
log.debug("polling...");
[clientid, psessionid] = [auth_opts.clientid, auth_opts.psessionid];
url = "http://d.web2.qq.com/channel/poll2";
r = ... | long_poll = (auth_opts, callback) ->
log.debug "polling..."
[clientid, psessionid] = [auth_opts.clientid, auth_opts.psessionid]
url = "http://d.web2.qq.com/channel/poll2"
r =
clientid: "#{clientid}"
psessionid: psessionid
key:0
ids:[]
params =
clientid: client... | JavaScript | CoffeeScript | xhan/qqbot | src/qqapi.coffee | MIT | 917291c872151d823d9d926aa39d2fdb97215e78 | 1,435 | https://github.com/xhan/qqbot/blob/917291c872151d823d9d926aa39d2fdb97215e78/src/qqapi.coffee | 25 | 71 |
xhan/qqbot:src/qqapi.coffee:2:completion | completion | long_poll = (auth_opts, callback) ->
log.debug "polling..."
[clientid, psessionid] = [auth_opts.clientid, auth_opts.psessionid]
url = "http://d.web2.qq.com/channel/poll2"
r =
clientid: "#{clientid}"
psessionid: psessionid
key:0
ids:[]
params =
clientid: client... | `
function(b, i) {
for (var a = [], s = 0; s < i.length; s++) a[s % 4] ^= i.charCodeAt(s);
var j = ["EC", "OK"],
d = [];
d[0] = b >> 24 & 255 ^ j[0].charCodeAt(0);
d[1] = b >> 16 & 255 ^ j[0].charCodeAt(1);
d[2] = b >> 8... | CoffeeScript | CoffeeScript | xhan/qqbot | src/qqapi.coffee | MIT | 917291c872151d823d9d926aa39d2fdb97215e78 | 1,435 | https://github.com/xhan/qqbot/blob/917291c872151d823d9d926aa39d2fdb97215e78/src/qqapi.coffee | 25 | 71 |
xhan/qqbot:src/qqapi.coffee:3:raw_corpus | raw_corpus | exports.get_buddy_list = (auth_opts, callback)->
opt = auth_opts
url = "http://s.web2.qq.com/api/get_user_friends2"
r =
h: "hello"
hash: hash_func(opt.uin, opt.ptwebqq)
vfwebqq: opt.vfwebqq
client.post {url:url} , {r:jsons(r)} , (ret,e )->
callback(ret,e)
# @param auth_opts... | CoffeeScript | xhan/qqbot | src/qqapi.coffee | MIT | 917291c872151d823d9d926aa39d2fdb97215e78 | 1,435 | https://github.com/xhan/qqbot/blob/917291c872151d823d9d926aa39d2fdb97215e78/src/qqapi.coffee | 72 | 86 | ||
xhan/qqbot:src/qqapi.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.get_buddy_list = (auth_opts, callback)->
opt = auth_opts
url = "http://s.web2.qq.com/api/get_user_friends2"
r =
h: "hello"
hash: hash_func(opt.uin, opt.ptwebqq)
vfwebqq: opt.vfwebqq
client.post {url:url} , {r:jsons(r)} ,... | exports.get_buddy_list = function(auth_opts, callback) {
var opt, r, url;
opt = auth_opts;
url = "http://s.web2.qq.com/api/get_user_friends2";
r = {
h: "hello",
hash: hash_func(opt.uin, opt.ptwebqq),
vfwebqq: opt.vfwebqq
};
return client.post({
url: url
}, {
r: jsons(r)
}, function(r... | CoffeeScript | JavaScript | xhan/qqbot | src/qqapi.coffee | MIT | 917291c872151d823d9d926aa39d2fdb97215e78 | 1,435 | https://github.com/xhan/qqbot/blob/917291c872151d823d9d926aa39d2fdb97215e78/src/qqapi.coffee | 72 | 86 |
xhan/qqbot:src/qqapi.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.get_buddy_list = function(auth_opts, callback) {
var opt, r, url;
opt = auth_opts;
url = "http://s.web2.qq.com/api/get_user_friends2";
r = {
h: "hello",
hash: hash_func(opt.uin, opt.ptwebqq),
vfwebqq: opt.vfwebqq
};
return client.pos... | exports.get_buddy_list = (auth_opts, callback)->
opt = auth_opts
url = "http://s.web2.qq.com/api/get_user_friends2"
r =
h: "hello"
hash: hash_func(opt.uin, opt.ptwebqq)
vfwebqq: opt.vfwebqq
client.post {url:url} , {r:jsons(r)} , (ret,e )->
callback(ret,e)
# @param auth_opts... | JavaScript | CoffeeScript | xhan/qqbot | src/qqapi.coffee | MIT | 917291c872151d823d9d926aa39d2fdb97215e78 | 1,435 | https://github.com/xhan/qqbot/blob/917291c872151d823d9d926aa39d2fdb97215e78/src/qqapi.coffee | 72 | 86 |
xhan/qqbot:src/qqapi.coffee:3:completion | completion | exports.get_buddy_list = (auth_opts, callback)->
opt = auth_opts
url = "http://s.web2.qq.com/api/get_user_friends2"
r =
h: "hello"
hash: hash_func(opt.uin, opt.ptwebqq)
vfwebqq: opt.vfwebqq | client.post {url:url} , {r:jsons(r)} , (ret,e )->
callback(ret,e)
# @param auth_opts vfwebqq : 登录后获得
# @param callback: ret, e
# retcode 0 | CoffeeScript | CoffeeScript | xhan/qqbot | src/qqapi.coffee | MIT | 917291c872151d823d9d926aa39d2fdb97215e78 | 1,435 | https://github.com/xhan/qqbot/blob/917291c872151d823d9d926aa39d2fdb97215e78/src/qqapi.coffee | 72 | 86 |
xhan/qqbot:src/qqapi.coffee:4:raw_corpus | raw_corpus | exports.get_group_list = ( auth_opts, callback)->
aurl = "http://s.web2.qq.com/api/get_group_name_list_mask2"
r = vfwebqq: auth_opts.vfwebqq
client.post {url:aurl} , {r:jsons(r)} , (ret, e )->
callback(ret,e)
# @param group_code: code
# @param auth_opts vfwebqq : 登录后获得
# @param callback: re... | CoffeeScript | xhan/qqbot | src/qqapi.coffee | MIT | 917291c872151d823d9d926aa39d2fdb97215e78 | 1,435 | https://github.com/xhan/qqbot/blob/917291c872151d823d9d926aa39d2fdb97215e78/src/qqapi.coffee | 87 | 99 | ||
xhan/qqbot:src/qqapi.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.get_group_list = ( auth_opts, callback)->
aurl = "http://s.web2.qq.com/api/get_group_name_list_mask2"
r = vfwebqq: auth_opts.vfwebqq
client.post {url:aurl} , {r:jsons(r)} , (ret, e )->
callback(ret,e)
# @param group_code: code
#... | exports.get_group_list = function(auth_opts, callback) {
var aurl, r;
aurl = "http://s.web2.qq.com/api/get_group_name_list_mask2";
r = {
vfwebqq: auth_opts.vfwebqq
};
return client.post({
url: aurl
}, {
r: jsons(r)
}, function(ret, e) {
return callback(ret, e);
});
};
// @param group_c... | CoffeeScript | JavaScript | xhan/qqbot | src/qqapi.coffee | MIT | 917291c872151d823d9d926aa39d2fdb97215e78 | 1,435 | https://github.com/xhan/qqbot/blob/917291c872151d823d9d926aa39d2fdb97215e78/src/qqapi.coffee | 87 | 99 |
xhan/qqbot:src/qqapi.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.get_group_list = function(auth_opts, callback) {
var aurl, r;
aurl = "http://s.web2.qq.com/api/get_group_name_list_mask2";
r = {
vfwebqq: auth_opts.vfwebqq
};
return client.post({
url: aurl
}, {
r: jsons(r)
}, function(ret, e) {
... | exports.get_group_list = ( auth_opts, callback)->
aurl = "http://s.web2.qq.com/api/get_group_name_list_mask2"
r = vfwebqq: auth_opts.vfwebqq
client.post {url:aurl} , {r:jsons(r)} , (ret, e )->
callback(ret,e)
# @param group_code: code
# @param auth_opts vfwebqq : 登录后获得
# @param callback: re... | JavaScript | CoffeeScript | xhan/qqbot | src/qqapi.coffee | MIT | 917291c872151d823d9d926aa39d2fdb97215e78 | 1,435 | https://github.com/xhan/qqbot/blob/917291c872151d823d9d926aa39d2fdb97215e78/src/qqapi.coffee | 87 | 99 |
xhan/qqbot:src/qqapi.coffee:4:completion | completion | exports.get_group_list = ( auth_opts, callback)->
aurl = "http://s.web2.qq.com/api/get_group_name_list_mask2"
r = vfwebqq: auth_opts.vfwebqq
client.post {url:aurl} , {r:jsons(r)} , (ret, e )-> | callback(ret,e)
# @param group_code: code
# @param auth_opts vfwebqq : 登录后获得
# @param callback: ret, e
# retcode 0 | CoffeeScript | CoffeeScript | xhan/qqbot | src/qqapi.coffee | MIT | 917291c872151d823d9d926aa39d2fdb97215e78 | 1,435 | https://github.com/xhan/qqbot/blob/917291c872151d823d9d926aa39d2fdb97215e78/src/qqapi.coffee | 87 | 99 |
xhan/qqbot:src/qqapi.coffee:5:raw_corpus | raw_corpus | exports.get_group_member = (group_code, auth_opts, callback)->
url = "http://s.web2.qq.com/api/get_group_info_ext2"
url += "?gcode=#{group_code}&cb=undefined&vfwebqq=#{auth_opts.vfwebqq}&t=#{new Date().getTime()}"
client.get {url:url}, (ret,e)->
callback(ret,e)
# @param to_uin: uin
# @param msg,... | CoffeeScript | xhan/qqbot | src/qqapi.coffee | MIT | 917291c872151d823d9d926aa39d2fdb97215e78 | 1,435 | https://github.com/xhan/qqbot/blob/917291c872151d823d9d926aa39d2fdb97215e78/src/qqapi.coffee | 100 | 111 | ||
xhan/qqbot:src/qqapi.coffee:5:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.get_group_member = (group_code, auth_opts, callback)->
url = "http://s.web2.qq.com/api/get_group_info_ext2"
url += "?gcode=#{group_code}&cb=undefined&vfwebqq=#{auth_opts.vfwebqq}&t=#{new Date().getTime()}"
client.get {url:url}, (ret,e)->
... | exports.get_group_member = function(group_code, auth_opts, callback) {
var url;
url = "http://s.web2.qq.com/api/get_group_info_ext2";
url += `?gcode=${group_code}&cb=undefined&vfwebqq=${auth_opts.vfwebqq}&t=${new Date().getTime()}`;
return client.get({
url: url
}, function(ret, e) {
return callback(re... | CoffeeScript | JavaScript | xhan/qqbot | src/qqapi.coffee | MIT | 917291c872151d823d9d926aa39d2fdb97215e78 | 1,435 | https://github.com/xhan/qqbot/blob/917291c872151d823d9d926aa39d2fdb97215e78/src/qqapi.coffee | 100 | 111 |
xhan/qqbot:src/qqapi.coffee:5:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.get_group_member = function(group_code, auth_opts, callback) {
var url;
url = "http://s.web2.qq.com/api/get_group_info_ext2";
url += `?gcode=${group_code}&cb=undefined&vfwebqq=${auth_opts.vfwebqq}&t=${new Date().getTime()}`;
return client.get({
... | exports.get_group_member = (group_code, auth_opts, callback)->
url = "http://s.web2.qq.com/api/get_group_info_ext2"
url += "?gcode=#{group_code}&cb=undefined&vfwebqq=#{auth_opts.vfwebqq}&t=#{new Date().getTime()}"
client.get {url:url}, (ret,e)->
callback(ret,e)
# @param to_uin: uin
# @param msg,... | JavaScript | CoffeeScript | xhan/qqbot | src/qqapi.coffee | MIT | 917291c872151d823d9d926aa39d2fdb97215e78 | 1,435 | https://github.com/xhan/qqbot/blob/917291c872151d823d9d926aa39d2fdb97215e78/src/qqapi.coffee | 100 | 111 |
xhan/qqbot:src/qqapi.coffee:6:raw_corpus | raw_corpus | exports.send_msg_2buddy = (to_uin , msg , auth_opts ,callback)->
url = "http://d.web2.qq.com/channel/send_buddy_msg2"
opt = auth_opts
r =
to: to_uin
face: 0
msg_id: parseInt Math.random()*100000 + 1000
clientid: "#{opt.clientid}"
psessionid: opt.psessionid
content: jsons ... | CoffeeScript | xhan/qqbot | src/qqapi.coffee | MIT | 917291c872151d823d9d926aa39d2fdb97215e78 | 1,435 | https://github.com/xhan/qqbot/blob/917291c872151d823d9d926aa39d2fdb97215e78/src/qqapi.coffee | 112 | 137 | ||
xhan/qqbot:src/qqapi.coffee:6:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.send_msg_2buddy = (to_uin , msg , auth_opts ,callback)->
url = "http://d.web2.qq.com/channel/send_buddy_msg2"
opt = auth_opts
r =
to: to_uin
face: 0
msg_id: parseInt Math.random()*100000 + 1000
clientid: "#{opt.clientid... | exports.send_msg_2buddy = function(to_uin, msg, auth_opts, callback) {
var opt, params, r, url;
url = "http://d.web2.qq.com/channel/send_buddy_msg2";
opt = auth_opts;
r = {
to: to_uin,
face: 0,
msg_id: parseInt(Math.random() * 100000 + 1000),
clientid: `${opt.clientid}`,
psessionid: opt.pses... | CoffeeScript | JavaScript | xhan/qqbot | src/qqapi.coffee | MIT | 917291c872151d823d9d926aa39d2fdb97215e78 | 1,435 | https://github.com/xhan/qqbot/blob/917291c872151d823d9d926aa39d2fdb97215e78/src/qqapi.coffee | 112 | 137 |
xhan/qqbot:src/qqapi.coffee:6:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.send_msg_2buddy = function(to_uin, msg, auth_opts, callback) {
var opt, params, r, url;
url = "http://d.web2.qq.com/channel/send_buddy_msg2";
opt = auth_opts;
r = {
to: to_uin,
face: 0,
msg_id: parseInt(Math.random() * 100000 + 1000),
... | exports.send_msg_2buddy = (to_uin , msg , auth_opts ,callback)->
url = "http://d.web2.qq.com/channel/send_buddy_msg2"
opt = auth_opts
r =
to: to_uin
face: 0
msg_id: parseInt Math.random()*100000 + 1000
clientid: "#{opt.clientid}"
psessionid: opt.psessionid
content: jsons ... | JavaScript | CoffeeScript | xhan/qqbot | src/qqapi.coffee | MIT | 917291c872151d823d9d926aa39d2fdb97215e78 | 1,435 | https://github.com/xhan/qqbot/blob/917291c872151d823d9d926aa39d2fdb97215e78/src/qqapi.coffee | 112 | 137 |
xhan/qqbot:src/qqapi.coffee:6:completion | completion | exports.send_msg_2buddy = (to_uin , msg , auth_opts ,callback)->
url = "http://d.web2.qq.com/channel/send_buddy_msg2"
opt = auth_opts
r =
to: to_uin
face: 0
msg_id: parseInt Math.random()*100000 + 1000
clientid: "#{opt.clientid}"
psessionid: opt.psessionid
content: jsons ... | clientid: opt.clientid
psessionid: opt.psessionid
# log params
client.post {url:url} , params , (ret,e) ->
log.debug 'send2user',jsons ret
callback( ret , e )
# @param gid: gid
# @param msg, 消息
# @param auth_opts: [clientid,psessionid]
# @param callback: ret, e
# @return ret retco... | CoffeeScript | CoffeeScript | xhan/qqbot | src/qqapi.coffee | MIT | 917291c872151d823d9d926aa39d2fdb97215e78 | 1,435 | https://github.com/xhan/qqbot/blob/917291c872151d823d9d926aa39d2fdb97215e78/src/qqapi.coffee | 112 | 137 |
xhan/qqbot:src/qqapi.coffee:7:raw_corpus | raw_corpus | exports.send_msg_2group = (gid, msg , auth_opts, callback)->
url = 'http://d.web2.qq.com/channel/send_qun_msg2'
opt = auth_opts
r =
group_uin: gid
msg_id: parseInt Math.random()*100000 + 1000
clientid: "#{opt.clientid}"
psessionid: opt.psessionid
content: jsons ["#{ms... | CoffeeScript | xhan/qqbot | src/qqapi.coffee | MIT | 917291c872151d823d9d926aa39d2fdb97215e78 | 1,435 | https://github.com/xhan/qqbot/blob/917291c872151d823d9d926aa39d2fdb97215e78/src/qqapi.coffee | 138 | 153 | ||
xhan/qqbot:src/qqapi.coffee:7:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.send_msg_2group = (gid, msg , auth_opts, callback)->
url = 'http://d.web2.qq.com/channel/send_qun_msg2'
opt = auth_opts
r =
group_uin: gid
msg_id: parseInt Math.random()*100000 + 1000
clientid: "#{opt.clientid}"
... | exports.send_msg_2group = function(gid, msg, auth_opts, callback) {
var opt, params, r, url;
url = 'http://d.web2.qq.com/channel/send_qun_msg2';
opt = auth_opts;
r = {
group_uin: gid,
msg_id: parseInt(Math.random() * 100000 + 1000),
clientid: `${opt.clientid}`,
psessionid: opt.psessionid,
co... | CoffeeScript | JavaScript | xhan/qqbot | src/qqapi.coffee | MIT | 917291c872151d823d9d926aa39d2fdb97215e78 | 1,435 | https://github.com/xhan/qqbot/blob/917291c872151d823d9d926aa39d2fdb97215e78/src/qqapi.coffee | 138 | 153 |
xhan/qqbot:src/qqapi.coffee:7:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.send_msg_2group = function(gid, msg, auth_opts, callback) {
var opt, params, r, url;
url = 'http://d.web2.qq.com/channel/send_qun_msg2';
opt = auth_opts;
r = {
group_uin: gid,
msg_id: parseInt(Math.random() * 100000 + 1000),
clientid: `$... | exports.send_msg_2group = (gid, msg , auth_opts, callback)->
url = 'http://d.web2.qq.com/channel/send_qun_msg2'
opt = auth_opts
r =
group_uin: gid
msg_id: parseInt Math.random()*100000 + 1000
clientid: "#{opt.clientid}"
psessionid: opt.psessionid
content: jsons ["#{ms... | JavaScript | CoffeeScript | xhan/qqbot | src/qqapi.coffee | MIT | 917291c872151d823d9d926aa39d2fdb97215e78 | 1,435 | https://github.com/xhan/qqbot/blob/917291c872151d823d9d926aa39d2fdb97215e78/src/qqapi.coffee | 138 | 153 |
xhan/qqbot:src/qqapi.coffee:7:completion | completion | exports.send_msg_2group = (gid, msg , auth_opts, callback)->
url = 'http://d.web2.qq.com/channel/send_qun_msg2'
opt = auth_opts
r =
group_uin: gid
msg_id: parseInt Math.random()*100000 + 1000
clientid: "#{opt.clientid}"
psessionid: opt.psessionid | content: jsons ["#{msg}" , ["font", {name:"宋体", size:"10", style:[0,0,0], color:"000000" }] ]
params =
r: jsons r
clientid: opt.clientid
psessionid:opt.psessionid
client.post {url:url} , params , (ret,e)->
log.debug 'send2group',jsons ret
callback(ret,e) | CoffeeScript | CoffeeScript | xhan/qqbot | src/qqapi.coffee | MIT | 917291c872151d823d9d926aa39d2fdb97215e78 | 1,435 | https://github.com/xhan/qqbot/blob/917291c872151d823d9d926aa39d2fdb97215e78/src/qqapi.coffee | 138 | 153 |
xhan/qqbot:src/qqapi.coffee:1:raw_corpus | raw_corpus | exports.cookies = (cookie)->
if cookie
all_cookies = cookie
client.global_cookies(all_cookies)
return all_cookies
# 长轮训,默认一分钟
# @param : [clientid,psessionid]
# @param callback: ret, e
# @return ret retcode 102,正常空消息 | CoffeeScript | xhan/qqbot | src/qqapi.coffee | MIT | ee971b16888aac8c556bad7d2af893a7a6d8480e | 1,435 | https://github.com/xhan/qqbot/blob/ee971b16888aac8c556bad7d2af893a7a6d8480e/src/qqapi.coffee | 14 | 24 | ||
xhan/qqbot:src/qqapi.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.cookies = (cookie)->
if cookie
all_cookies = cookie
client.global_cookies(all_cookies)
return all_cookies
# 长轮训,默认一分钟
# @param : [clientid,psessionid]
# @param callback: ret, e
# @return ret retcode 102,正常空消息
``` | exports.cookies = function(cookie) {
var all_cookies;
if (cookie) {
all_cookies = cookie;
client.global_cookies(all_cookies);
}
return all_cookies;
};
// 长轮训,默认一分钟
// @param : [clientid,psessionid]
// @param callback: ret, e
// @return ret retcode 102,正常空消息 | CoffeeScript | JavaScript | xhan/qqbot | src/qqapi.coffee | MIT | ee971b16888aac8c556bad7d2af893a7a6d8480e | 1,435 | https://github.com/xhan/qqbot/blob/ee971b16888aac8c556bad7d2af893a7a6d8480e/src/qqapi.coffee | 14 | 24 |
xhan/qqbot:src/qqapi.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.cookies = function(cookie) {
var all_cookies;
if (cookie) {
all_cookies = cookie;
client.global_cookies(all_cookies);
}
return all_cookies;
};
// 长轮训,默认一分钟
// @param : [clientid,psessionid]
// @param callback: ret, e
// @return ret retco... | exports.cookies = (cookie)->
if cookie
all_cookies = cookie
client.global_cookies(all_cookies)
return all_cookies
# 长轮训,默认一分钟
# @param : [clientid,psessionid]
# @param callback: ret, e
# @return ret retcode 102,正常空消息 | JavaScript | CoffeeScript | xhan/qqbot | src/qqapi.coffee | MIT | ee971b16888aac8c556bad7d2af893a7a6d8480e | 1,435 | https://github.com/xhan/qqbot/blob/ee971b16888aac8c556bad7d2af893a7a6d8480e/src/qqapi.coffee | 14 | 24 |
xhan/qqbot:src/qqapi.coffee:6:raw_corpus | raw_corpus | exports.send_msg_2buddy = (to_uin , msg , auth_opts ,callback)->
url = "http://d.web2.qq.com/channel/send_buddy_msg2"
opt = auth_opts
r =
to: to_uin
face: 0
msg_id: 1000001 #随机msgid
clientid: "#{opt.clientid}"
psessionid: opt.psessionid
content: jsons ["#{msg}" , ["font",... | CoffeeScript | xhan/qqbot | src/qqapi.coffee | MIT | 918e7deefb56a60b0aaee2e4c067115501e7a2d5 | 1,435 | https://github.com/xhan/qqbot/blob/918e7deefb56a60b0aaee2e4c067115501e7a2d5/src/qqapi.coffee | 111 | 136 | ||
xhan/qqbot:src/qqapi.coffee:6:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.send_msg_2buddy = (to_uin , msg , auth_opts ,callback)->
url = "http://d.web2.qq.com/channel/send_buddy_msg2"
opt = auth_opts
r =
to: to_uin
face: 0
msg_id: 1000001 #随机msgid
clientid: "#{opt.clientid}"
psessionid:... | exports.send_msg_2buddy = function(to_uin, msg, auth_opts, callback) {
var opt, params, r, url;
url = "http://d.web2.qq.com/channel/send_buddy_msg2";
opt = auth_opts;
r = {
to: to_uin,
face: 0,
msg_id: 1000001, //随机msgid
clientid: `${opt.clientid}`,
psessionid: opt.psessionid,
content: j... | CoffeeScript | JavaScript | xhan/qqbot | src/qqapi.coffee | MIT | 918e7deefb56a60b0aaee2e4c067115501e7a2d5 | 1,435 | https://github.com/xhan/qqbot/blob/918e7deefb56a60b0aaee2e4c067115501e7a2d5/src/qqapi.coffee | 111 | 136 |
xhan/qqbot:src/qqapi.coffee:6:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.send_msg_2buddy = function(to_uin, msg, auth_opts, callback) {
var opt, params, r, url;
url = "http://d.web2.qq.com/channel/send_buddy_msg2";
opt = auth_opts;
r = {
to: to_uin,
face: 0,
msg_id: 1000001, //随机msgid
clientid: `${opt.cli... | exports.send_msg_2buddy = (to_uin , msg , auth_opts ,callback)->
url = "http://d.web2.qq.com/channel/send_buddy_msg2"
opt = auth_opts
r =
to: to_uin
face: 0
msg_id: 1000001 #随机msgid
clientid: "#{opt.clientid}"
psessionid: opt.psessionid
content: jsons ["#{msg}" , ["font",... | JavaScript | CoffeeScript | xhan/qqbot | src/qqapi.coffee | MIT | 918e7deefb56a60b0aaee2e4c067115501e7a2d5 | 1,435 | https://github.com/xhan/qqbot/blob/918e7deefb56a60b0aaee2e4c067115501e7a2d5/src/qqapi.coffee | 111 | 136 |
xhan/qqbot:src/qqapi.coffee:6:completion | completion | exports.send_msg_2buddy = (to_uin , msg , auth_opts ,callback)->
url = "http://d.web2.qq.com/channel/send_buddy_msg2"
opt = auth_opts
r =
to: to_uin
face: 0
msg_id: 1000001 #随机msgid
clientid: "#{opt.clientid}"
psessionid: opt.psessionid
content: jsons ["#{msg}" , ["font",... | clientid: opt.clientid
psessionid: opt.psessionid
# log params
client.post {url:url} , params , (ret,e) ->
log.debug 'send2user',jsons ret
callback( ret , e )
# @param gid: gid
# @param msg, 消息
# @param auth_opts: [clientid,psessionid]
# @param callback: ret, e
# @return ret retco... | CoffeeScript | CoffeeScript | xhan/qqbot | src/qqapi.coffee | MIT | 918e7deefb56a60b0aaee2e4c067115501e7a2d5 | 1,435 | https://github.com/xhan/qqbot/blob/918e7deefb56a60b0aaee2e4c067115501e7a2d5/src/qqapi.coffee | 111 | 136 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.