Created
April 2, 2014 01:11
-
-
Save ashizawa/9926226 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
| #!/usr/bin/env node | |
| var querystring = require('querystring'); | |
| var https = require('https'); | |
| var fs = require('fs'); | |
| var url = process.argv[2]; | |
| var post_data = querystring.stringify({ | |
| id : url, | |
| scrape: true | |
| }); | |
| var post_options = { | |
| hostname: 'graph.facebook.com', | |
| port: 443, | |
| method: 'POST', | |
| headers: { | |
| 'Content-Type': 'application/x-www-form-urlencoded', | |
| 'Content-Length': Buffer.byteLength(post_data) | |
| } | |
| }; | |
| console.log("post " + url); | |
| var req = https.request(post_options, function(response){ | |
| response.setEncoding('utf8'); | |
| response.on('data', function (chunk) { | |
| console.log(chunk); | |
| }); | |
| }); | |
| console.log("data sending"); | |
| req.write(post_data); | |
| req.end(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment