Last active
December 23, 2017 20:20
-
-
Save 0xjgv/df4582f0ef7e49c2a811ea23c647932f to your computer and use it in GitHub Desktop.
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 Apify = require('apify'); | |
const request = require('request-promise'); | |
Apify.main(async () => { | |
// Get input of your act | |
const input = await Apify.getValue('INPUT'); | |
console.log('My input:'); | |
console.dir(input); | |
// Do something useful here | |
const html = await request('http://www.example.com'); | |
// And then save output | |
const output = { | |
html, | |
crawledAt: new Date(), | |
}; | |
console.log('My output:'); | |
console.dir(output); | |
await Apify.setValue('OUTPUT', output); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment