Install Taro client
npm install taro-client
Create email templates
@import url('https://fonts.googleapis.com/css?family=Open+Sans:300,400,500'); | |
* { | |
box-sizing: border-box; | |
} | |
html, | |
body { | |
font-family: 'Open Sans', 'Helvetica Neue', Arial, san-serif; | |
line-height: 1.15; |
import request from 'superagent'; | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import { | |
StripeProvider, | |
Elements, | |
CardElement, | |
injectStripe | |
} from 'react-stripe-elements'; |
const request = require('superagent'); | |
const ping = async () => { | |
const res = await request.get('https://taro-beta.herokuapp.com/api/ping'); | |
return res.body; | |
}; | |
// Run function and verify output | |
ping().then(console.log).catch(console.log); |
const request = require('superagent'); | |
const _ = require('lodash'); | |
const getRandomInspirationalQuote = async () => { | |
const {text: json} = await request.get('https://type.fit/api/quotes'); | |
const quotes = JSON.parse(json); | |
return _.sample(quotes); | |
}; |
const request = require('superagent'); | |
const checkItemInStock = async () => { | |
// Checks to see if the product in the URL below is in stock | |
const {text: html} = await request.get( | |
'https://www.bowflex.com/selecttech/552/100131.html' | |
); | |
const inStock = html.toLowerCase().indexOf('out of stock') === -1; | |
return {inStock}; |
const request = require('superagent'); | |
const cheerio = require('cheerio'); | |
const _ = require('lodash'); | |
const scraper = async (threshold = 200) => { | |
const url = 'https://news.ycombinator.com/' | |
const {text: html} = await request.get(url); | |
const $ = cheerio.load(html); | |
const links = $('.storylink').map((i, el) => { | |
return {href: $(el).attr('href'), text: $(el).text()}; |
const moment = require('moment'); | |
const request = require('superagent'); | |
const cheerio = require('cheerio'); | |
const _ = require('lodash'); | |
const scraper = async () => { | |
const url = 'https://news.ycombinator.com/jobs' | |
const {text: html} = await request.get(url); | |
const $ = cheerio.load(html); | |
const links = $('.storylink').map((i, el) => { |
const request = require('superagent'); | |
const _ = require('lodash'); | |
const getTopPosts = async (subreddit, options = {}) => { | |
const {count = 5, interval = 'week'} = options; | |
const sub = `https://www.reddit.com/r/${subreddit}/top.json?sort=top&t=${interval}`; | |
const res = await request.get(sub); | |
const {children: posts} = res.body.data; | |
return posts.slice(0, count).map((post) => { |
const request = require('superagent'); | |
const checkItemInStock = async () => { | |
const {text: html} = await request.get( | |
'https://www.bowflex.com/selecttech/552/100131.html' | |
); | |
const inStock = html.toLowerCase().indexOf('out of stock') === -1; | |
return {inStock}; | |
}; |