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
<form method="post" action="https://contact-us.prod.with-datafire.io/contact"> | |
<label>Your e-mail</label> | |
<input type="text" name="from"> | |
<label>Message</label> | |
<textarea name="message"></textarea> | |
</form> |
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
var CONTACT_ADDRESS = 'me@company.com'; | |
var querystring = require('querystring'); | |
var mailer = require('nodemailer').createTransport({ | |
service: 'Gmail', | |
auth: { | |
user: process.env.GMAIL_ADDRESS, | |
pass: process.env.GMAIL_PASSWORD, | |
} | |
}); |
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
let app = require('express')(); | |
app.use(require('body-parser').urlencoded()); | |
app.post('/contact', function(req, res) { | |
console.log('new message', req.body); | |
}); | |
app.listen(3000); |
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
<form method="post" action="http://api.company.com/contact"> | |
<label>Your e-mail</label> | |
<input type="text" name="from"> | |
<label>Subject</label> | |
<input type="text" name="subject"> | |
<label>Message</label> | |
<textarea name="body"></textarea> | |
</form> |
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
<a href="mailto:me@company.com?subject=Hello&body=We+want+to+hire+you">Contact Us</a> |
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
<a href="mailto:me@company.com">Contact Us</a> |
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
let hn = require('@datafire/hacker_news').create(); | |
(async () => { | |
let storyIDs = await hn.getStories({storyType: 'top'}); | |
// Using for loop (runs in series) | |
for (let itemID of storyIDs) { | |
let details = await hn.getItem({itemID}); | |
console.log(details); | |
} |
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
let hn = require('@datafire/hacker_news').create(); | |
(async () => { | |
let storyIDs = await hn.getStories({storyType: 'top'}); | |
let topStory = await hn.getItem({itemID: storyIDs[0]}); | |
console.log(`Top story: ${topStory.title} - ${topStory.url}`); | |
})(); |
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
let hn = require('@datafire/github').create(); | |
(async () => { | |
let newIssue = await github.repos.owner.repo.issues.post({ | |
owner: 'torvalids', | |
repo: 'linux', | |
body: { | |
title: "Fix the thing!", | |
body: "It's broke", | |
} |
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
let hn = require('@datafire/hacker_news').create(); | |
let firstUser = null; | |
let secondUser = null; | |
Promise.resolve() | |
.then(_ => hn.getUser({username: 'sama'})) | |
.then(user => { | |
firstUser = user; | |
return hn.getUser({username: 'pg'}) |