This file contains hidden or 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
| import os | |
| import twitter | |
| from datetime import datetime, timedelta | |
| def hello_cloudscheduler(event, context): | |
| # API keys | |
| consumer_key = os.environ['CONSUMER_KEY'] | |
| consumer_secret = os.environ['CONSUMER_SECRET'] |
This file contains hidden or 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
| const { google } = require('googleapis'); | |
| const dataflow = google.dataflow('v1b3'); | |
| const TEMPLATE_BUCKET = `your-bucket`; | |
| module.exports.kickOffDataflow = async (event, event_description) => { // Check if the file was put in 'input/' folder | |
| if (!event['id'].includes('/input/')){ | |
| return | |
| } | |
| const input = 'gs://' + event['id'].split('/').slice(0, -1).join('/') | |
| const jobName = `citiesonbigquery`; | |
| const tmpLocation = `gs://${TEMPLATE_BUCKET}/tmp`; |