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
| const puppeteer = require('puppeteer'); | |
| (async () => { | |
| const browser = await puppeteer.launch({ | |
| args: ['--no-sandbox', '--disable-setuid-sandbox'], | |
| headless: false | |
| }); | |
| const page = await browser.newPage(); | |
| await page.goto('https://example.com'); | |
| await page.screenshot({path: 'example.png'}); |
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
| const YahooFinanceAPI = require('yahoo-finance-data') | |
| // fill in Yahoo Finance API keys here | |
| const api = new YahooFinanceAPI({ | |
| key: null, | |
| secret: null | |
| }) | |
| const talib = require('talib') | |
| console.log("TALib Version: " + talib.version) |
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
| var Promise = require('bluebird'); | |
| var MongoDB = Promise.promisifyAll(require("mongodb")); | |
| var MongoClient = Promise.promisifyAll(MongoDB.MongoClient); | |
| var cheerio = require('cheerio'); | |
| var http = require('http'); | |
| var urls = [ | |
| 'http://www.magentocommerce.com/certification/directory/index/?q=&country_id=AU®ion_id=®ion=vic&certificate_type=', | |
| 'http://www.magentocommerce.com/certification/directory/index/?q=&country_id=AU®ion_id=®ion=victoria&certificate_type=' | |
| ]; |
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
| function validateUrl(value) | |
| { | |
| var expression = /[-a-zA-Z0-9@:%_\+.~#?&//=]{2,256}\.[a-z]{2,4}\b(\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?/gi | |
| var regexp = new RegExp(expression); | |
| return regexp.test(value); | |
| } |
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
| // please leave this notice intact, otherwise do as you please :) | |
| // by [email protected] | |
| // get more info at http://franciskim.co/2015/07/22/how-to-create-a-weather-bot-for-slack-chat/ | |
| var express = require('express'); | |
| var app = express(); | |
| var http = require('http'); | |
| var Slackhook = require('slackhook'); | |
| var slack = new Slackhook({ | |
| domain: 'yoursubdomain', |