Last active
March 23, 2020 10:34
-
-
Save ernestkamara/894831f45f5e7094d3a203f73d4f5b30 to your computer and use it in GitHub Desktop.
Cloud Functions Demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create the serpwow object, passing in our API key | |
const serpwow = new SerpWow(API_KEY); | |
// Initialize the default app | |
admin.initializeApp({ | |
credential: admin.credential.cert(serviceAccount), | |
databaseURL: "https://APP_ID.firebaseio.com" | |
}); | |
// Minimum time period(i.e. 'from') search parameter | |
const min_date = moment().subtract(1, 'days').format("MM/DD/YYYY"); | |
// Maximum time period(i.e. 'to') search parameter | |
const max_date = moment().format("MM/DD/YYYY"); | |
// Set up the search parameters, | |
const params = { | |
q: 'freetown', | |
search_type: 'news', | |
news_type: 'all', | |
num: '10', | |
time_period: 'custom', | |
sort_by: 'date', | |
time_period_min: min_date, | |
time_period_max: max_date | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment