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.
famous-quotes
Advanced tools
Readme
An Express wrapper for the "Random Famous Quotes" API found on Mashape. Link: https://market.mashape.com/andruxnet/random-famous-quotes
The response body of the GET
request to the endpoint will be an object with a quote
and author
property. See examples for more details.
You may use this for a "quote of the day", at least, that's what I use it for. Or perhaps you could have a button that generates a random quote when clicked. Keep in mind that there are likely rate limits for the API; this wrapper does not limit the number of requests you can make, so please do your own research if you plan to do something request intensive.
key
(String) The secret key provided by Mashapeoptions
(Object)
default
(Object) The default quote to be shown, if the request fails, for some reason. Below are the relevant properties.
quote
author
use
d for middleware.options
(Object) Properties below.
type
(String) The quote type. There are two options, the default, 'famous'
, and 'movies'
.count
Integer The number of quotes to be returned, with a maximum limit of 100. Defaults to 1.refresh
(Integer) The amount of delay, in milliseconds, between each .genQuote()
call. Defaults to one day.options
(Object) The options object to be passed to .genQuote()
..genQuote()
every X milliseconds;const DEFAULT_QUOTE = {
quote: 'Don\'t let schooling interfere with your education.',
author: 'Mark Twain'
};
const MASHAPE_KEY = 'SOME_KEY';
const express = require('express');
const quoteMaker = require('famous-quotes')(MASHAPE_KEY, DEFAULT_QUOTE);
const app = express();
// Regenerate a new quote every hour
quoteMaker.getGenerator(1000 * 60 * 60);
app.use('myendpoint', quoteMaker.getRouter());
And on client-side... (I'm using Angular, and omitted some steps; consider it an exercise for the reader to fill in the steps ;))
$http({
method: 'GET',
url: 'myendpoint'
}).then(function(res) {
console.log('Quote: ' + res.data.quote);
console.log('Author: ' + res.data.author);
}, function(err) {
console.log(err);
});
FAQs
An Express wrapper for the "Random Famous Quotes" API found on Mashape.
The npm package famous-quotes receives a total of 1 weekly downloads. As such, famous-quotes popularity was classified as not popular.
We found that famous-quotes 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.