Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
plurk
Advanced tools
Readme
Easy-to-use library for Plurk API 2.0. Parses JSON data automatically and handles comet channel.
npm install plurk
Instead of this:
oauth.post("http://www.plurk.com/APP/Profile/getPublicProfile",
"ACCESS_TOKEN", "ACCESS_TOKEN_SECRET",
{"user_id": "plurkapi"},
function (err, json) {
if (err) return;
var data;
try {
data = JSON.parse(json);
} catch (e) {
return;
}
console.log(data);
});
You can do this:
plurkClient.rq("Profile/getPublicProfile", {"user_id": "plurkapi"}, function (err, data) {
if (err) return;
console.log(data);
});
var PlurkClient = require('plurk').PlurkClient;
var client = new PlurkClient(https, consumerKey, consumerSecret, accessToken, accessTokenSecret);
// https: true or false, for requesting request token and access token
// accessToken and accessTokenSecret are optional and can be set afterward.
client.accessToken = "MY_ACCESS_TOKEN";
client.accessTokenSecret = "MY_ACCESS_TOKEN_SECRET";
Or you can instantiate client from json config file:
var client = require('plurk').fromFileSync('config.json')
config.json:
{
"https": true
, "consumerKey": "MY_CONSUMER_KEY"
, "consumerSecret": "MY_CONSUMER_SECRET"
, "accessToken": "MY_ACCESS_TOKEN"
, "accessTokenSecret": "MY_ACCESS_TOKEN_SECRET"
}
Again, accessToken and accessTokenSecret are optional.
Async read method is also available:
require('plurk').fromFile('config.json', function (err, client) {
if (!err) {
// ...
}
});
See examples/getToken.js for example usage.
PlurkClient.prototype.getRequestToken // alias: getOAuthRequestToken
PlurkClient.prototype.getAccessToken // alias: getOAuthAccessToken
These two methods are as same as methods on @ciaranj/node-oauth.
See examples/getPublicProfile.js for example usage.
PlurkClient.prototype.rq = function(api, obj, callback [, accessToken, accessTokenSecret])
// pass null for obj argument if no parameter required by Plurk API.
client.rq('Profile/getPublicProfile', {'user_id': "plurkapi"}, function(err, data) {
if (!err) console.log(data);
});
Helper functions were created for handling data of comet API.
See examples/basic_comet.js for example usage.
Also check out examples/robot.js which demonstrates how to make a simple Plurk robot.
var limitedTo = require('plurk').limitedTo;
limitedTo.parse("|1||2|"); // returns [1, 2]
limitedTo.stringify([1, 2]); // returns "|1||2|"
var urlMatch = require('plurk').urlMatch;
var userId = urlMatch.user('http://www.plurk.com/ChronoPlurk');
// returns "ChronoPlurk"
var plainPlurkId = urlMatch.plurk('http://www.plurk.com/p/foo3ly')
// returns "foo3ly"
var plurkId = urlMatch.plurk('http://www.plurk.com/p/foo3ly', true)
// returns 948427846 (require('plurk').base36.decode)
Mobile version of URL works, too.
var userId = urlMatch.user('http://www.plurk.com/m/u/ChronoPlurk');
// returns "ChronoPlurk"
var plurkId = urlMatch.plurk('http://www.plurk.com/m/p/foo3ly', true)
// returns 948427846
FAQs
Easy-to-use library for Plurk API 2.0. Parses JSON data automatically and handles comet channel.
The npm package plurk receives a total of 1 weekly downloads. As such, plurk popularity was classified as not popular.
We found that plurk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.