Skip to content

Instantly share code, notes, and snippets.

View andreasasprou's full-sized avatar

Andreas Asprou andreasasprou

View GitHub Profile
_getData = () => {
// Lets first set loading and disabled to be true
this.setState({ loading: true, disabled: true });
fetch('http://192.168.0.39/UserInfo/get_power_level.php')
//convert response to JSON format
.then((response) => response.json())
.then((responseJson) => {
// responseJson should be an object with a key "id", so we can access "id" by writing responseJson.id
require('chromedriver');
const webdriver = require('selenium-webdriver');
const cheerio = require('cheerio');
const Builder = webdriver.Builder
const By = webdriver.By
const until = webdriver.until
const driver = new Builder()
.setAlertBehavior('ignore')
/* Connecting to a channel */
export function connectToChannelListener() {
takeLatest(OPEN_CHANNEL, connectToChannelHandler);
}
export function* connectToChannelHandler({ uuid }) {
try {
const socket = yield call(connect, uuid);
@andreasasprou
andreasasprou / facebookProfile.js
Created March 19, 2017 20:12
Minimal Facebook profile scraper
var fs = require('fs');
var casper = require('casper').create({
verbose: true,
userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36",
pageSettings: {
loadImages: false,
loadPlugins: false
}
});