Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
afpnews-api
Advanced tools
This project is aimed to help javascript developers use the AFP Core API.
It provides authentication, searching for documents function, and online news product.
This package is available both for NodeJS and browsers. That's why two versions are available on the ./dist
directory.
You'll need an API key and credentials to retrieve all content from the API.
npm install --save afpnews-api
const { ApiCore } = require('afpnews-api')
// OR using import
import { ApiCore } from 'afpnews-api'
<script src="./dist/bundles/apicore.min.js"></script>
// Initialize the API
const apicore = new ApiCore({ clientId, clientSecret })
// Authenticate
await apicore.authenticate({ username, password })
// Get token changed
apicore.on('tokenChanged', token => console.log(token))
// Search for latest documents
const { documents } = await apicore.search()
// Or using a generator to crawl multiple pages
for await (const doc of apicore.searchAll()) {
console.log(doc)
}
// Get a specific document
const document = await apicore.get(uno)
// Look for similar documents
const { documents } = await apicore.mlt(uno)
// Display the most used slugs
const { keywords } = await apicore.list('slug')
The above request use default parameters stored in ./src/default-search-params.js
You can pass your own parameters to the search function, that will overide the defaults.
The query parameter can be used to look precisely for a field (title:Macron
) and may include logical parameters (Macron OR Merkel
, Macron AND NOT Merkel
, (title:Macron OR title:Merkel) AND country:fra
).
Clone the repository, then npm install
Build and minify your work for browsers and node with npm run build
Just npm test
to execute all tests in ./tests
You will need some environment variables in a .env file :
AFPNEWS_BASE_URL=
AFPNEWS_API_KEY=
AFPNEWS_CLIENT_ID=
AFPNEWS_CLIENT_SECRET=
AFPNEWS_USERNAME=
AFPNEWS_PASSWORD=
This project is licensed under the MIT License - see the LICENSE.md file for details
FAQs
Node helper functions to authenticate and fetch AFP News API
We found that afpnews-api 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
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.