Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
A 500px.com wrapper that does a little more than the existing 500px
node module :wink:. Wraps the 500px API, exposing a clean, well-tested, promise-based interface with support for authenticated requests.
$ npm install 600px
Require it into your project as usual. The main module is a class that requires a configuration object to be correctly initialized. You need a consumer_key
for the public methods, and a bit more information for the authenticated methods, which we'll talk about in the next section.
var API = require('600px'),
api = new API({ consumer_key: 'xxx' });
Now you have an object available for each API endpoint, as such:
var Photos = api.photos;
var Users = api.users;
var Blogs = api.blogs;
var Collections = api.collections;
There are a number of methods to make specific API requests on each of these endpoints, documented below. At the moment, only GET
methods are supported, although I plan on adding support for POST
and PUT
methods down the line as well, and the architecture is in place for it.
This library is intended for personal use and therefore does not include a full authorization flow. If you do need to authorize, it has to happen in the browser through OAuth, and you can use the officially maintained 500px client-side js library for this.
Unfortunately, 500px offers no way for you to easily obtain a personal access token, so you need to go through the whole OAuth thing and make a dummy app in order to get the info you need to make authenticated requests. Here are a set of steps you can take to get personal access tokens fairly painlessly:
https://grant-oauth.herokuapp.com/connect/500px/callback
.app
box, and enter in your application's consumer key and secret which you just generatedconsumer_key
, consumer_secret
, token
, and token_secret
, which you now have all of. Initialize this library's class with those four, named appropriately, and you will be able to make authenticated calls.With this done, you can hit any endpoint without errors. Without this in place, the endpoints that indicate that they require OAuth in 500px's API docs will return an error.
To retrieve photos, use photos
on the instantiated class with any of the methods listed below. A brief example:
api.photos.getPopular({'sort': 'created_at', 'rpp': '100'})
.catch(console.error)
.then(console.log);
Note that each method returns a A+ compliant promise generated by when.js. If you don't know how to use promises, don't worry at all, the basics are super easy. You can just follow the example as above: use then
to execute a function on success and catch
on error. Below are all the photo-related functions you can use:
getById (photo_id, arguments)
getByUsername (username, arguments)
getByUserId (user_id, arguments)
getFavoritesByUsername (username, arguments)
getFavoritesByUserId (user_id, arguments)
getFriendsByUsername (username, arguments)
getFriendsByUserId (user_id, arguments)
getPopular (arguments)
getUpcoming (arguments)
getEditorsChoice (arguments)
getFreshToday (arguments)
getFreshYesterday (arguments)
getFreshWeek (arguments)
searchByTag (tag, arguments)
searchByTerm (term, arguments)
For more information on the possible arguments, please check the 500px.com photos API
Example:
api.users.getById(1234)
.catch(console.error)
.then(console.log);
Available functions:
get (arguments)
getById (id, arguments)
getByName (username, arguments)
getByEmail (email, arguments)
getFriendsById (id, arguments)
For more information on the possible arguments, please check the 500px.com users API
Example:
api.blogs.getFresh()
.catch(console.error)
.then(console.log);
Functions:
getById (id, arguments)
getCommentsById (id, arguments)
getFresh (arguments)
getByUsername (username, arguments)
getByUserId (user_id, arguments)
For more information on the possible arguments, please check the 500px.com blogs API
Note that all collections endpoints require full authentication credentials.
Example:
api.collections.get()
.catch(console.error)
.then(console.log);
Functions:
get (arguments)
getById (id, arguments)
For more information on the possible arguments, please check the 500px.com collections API
Licensed under MIT (see license »)
FAQs
A wrapper for the 500px.com API
The npm package 600px receives a total of 1 weekly downloads. As such, 600px popularity was classified as not popular.
We found that 600px 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.