Install Taro client
npm install taro-client
Create email templates
import {useRouter} from 'next/router'; | |
import {useEffect} from 'react'; | |
// Small hack to inject a Google font into the webpage | |
function appendCustomFont(font: string) { | |
if (typeof document === 'undefined') { | |
return console.warn( | |
'`window.document` unavailable: cannot append custom font.' | |
); | |
} |
.ChatWidget{margin:0}.TextArea--transparent,.TextArea--transparent:active,.TextArea--transparent:focus,.TextArea--transparent:hover{border:none;box-shadow:none;resize:none;outline:0}button.WidgetToggle{outline:none;border:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;cursor:pointer;width:50px;height:50px;border-radius:50%;display:flex;justify-content:center;align-items:center} |
parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({ |
const Taro = require('taro-client')( | |
'__YOUR_API_KEY__' | |
); | |
const main = async () => { | |
const posts = await Taro.scrape.hn({threshold: 400}); | |
if (posts.length === 0) { | |
return; | |
} |
const Taro = require('taro-client')('__YOUR_API_KEY__'); | |
Taro.notify.slack({message: 'Hello from NodeJS!'}); |
const request = require('superagent'); | |
const Taro = require('taro-client')( | |
// Replace this with your Taro API key | |
process.env.TARO_API_KEY | |
); | |
const getTopPost = async (subreddit) => { | |
const sub = `https://www.reddit.com/r/${subreddit}/top.json`; | |
const res = await request.get(sub).query({sort: 'top', t: 'day'}); | |
const {children: posts} = res.body.data; |
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 () => { | |
// 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}; |