![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
@nickacide/redditjs
Advanced tools
RedditJS is a JavaScript library for interacting with Reddit's official API. Not only is it lightweight, it's also easy to use.
Install via npm
:
npm install --save js-reddit
RedditJS requires events
and request-promise
as dependencies.
API
To get started, you need to create an app. To understand how Reddit apps work, I suggest reading about it here.
Web App
or Script
).refresh token
, client id
and client secret
.Now that you have everything you need, you can start writing some code. Here is an example for posting a link on Reddit.
const Reddit = require('js-reddit');
const client = new Reddit.Client({
refresh_token: "refresh token",
secret: "client secret",
id: "client id"
});
client.on('authorized', () => {
console.log(`Logged in! My token is ${client.token}`)
})
client.authenticate();
client.post('/api/submit', {
sr: 'memes',
resubmit: true,
kind: 'link',
title: 'Title for my Link',
url: 'https://www.example.com'
}).then(results => {
console.log(results)
});
{
json: {
errors: [],
data: {
url: 'link to message on reddit',
drafts_count: 0,
id: 'unique-ID',
name: 't3_unique-ID'
}
}
}
At the time of this writing, no Documentation exists yet, as this package lacks features. For now, the functionality of this package will be shown here. *Code is case-sensitive.
Client
extends EventEmitter
Properties
Client.id
The id of the app you createdClient.secret
The secret of your appClient.refresh_token
The token used to generate access tokensClient.token
The access token (Regenerated every 3950 seconds)Client.user_agent
(Optional) Your User Agent. Always try provide one.Methods
Client.authenticate()
Authorize your app and generate an access tokenClient.get(path, options)
where path
: The api path you want to invoke, options
: The options required for the requestClient.put(path, options)
where path
: The api path you want to invoke, options
: The options required for the requestClient.post(path, options)
where path
: The api path you want to invoke, options
: The options required for the requestClient.patch(path, options)
where path
: The api path you want to invoke, options
: The options required for the requestClient.delete(path, options)
where path
: The api path you want to invoke, options
: The options required for the requestEvents
authorized
Emitted when the Client
successfully authenticated.Questions can be asked by creating an Issue or asking in my Discord server. If you have a suggestion, please tell me! I am not online everyday, so do not expect the fastest responses. If you would like to become a contributor for this repository or a mod in my Discord server, simply ask!
FAQs
A JavaScript library for Reddit's API.
The npm package @nickacide/redditjs receives a total of 1 weekly downloads. As such, @nickacide/redditjs popularity was classified as not popular.
We found that @nickacide/redditjs 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
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.