Last active
April 10, 2018 20:06
-
-
Save malte-j/b45888aa18ee75520a25c3017d257118 to your computer and use it in GitHub Desktop.
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
const request = require('request'); | |
// Request Header | |
var headers = { | |
'User-Agent': 'Secret Agent/0.0.1', | |
'Content-Type': 'application/x-www-form-urlencoded' | |
} | |
// Liste der comments | |
const comments = [ | |
{ | |
name: 'Max Mustermann', | |
text: 'Lorem Ipsum' | |
}, | |
{ | |
name: 'Maxi Musterfrau', | |
text: 'Dolor Sit Amet' | |
} | |
] | |
// Posten | |
comments.forEach(comment => request({ | |
url: 'http://www.hgotv.herbartgymnasium.de/', | |
method: 'POST', | |
headers: headers, | |
form: { | |
nicknameInput: comment.name, | |
commentInput: comment.text, | |
mathInput: 12 | |
} | |
}, (err, res, body) => console.log(err? err : 'success'))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment