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
def hide_comment(webhook_comment_callback): | |
page_access_token = "" | |
base = "https://graph.facebook.com/v2.8" | |
node = "/%s" % webhook_comment_callback['value']['comment_id'] | |
fields = "?is_hidden=true" | |
parameters = "&access_token=%s" % page_access_token | |
url = base + node + fields + parameters | |
print("URL : ", url) | |
req = urllib.request.Request(url) | |
success = False |
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
Internal Server Error: /fb_webhooks/d1a0311fe8b709a5cb027ae2567a692712fad78702d6b78b5a/ | |
Traceback (most recent call last): | |
File "C:\Python34\lib\site-packages\django\core\handlers\exception.py", line 39, in inner | |
response = get_response(request) | |
File "C:\Python34\lib\site-packages\django\core\handlers\base.py", line 249, in _legacy_get_response | |
response = self._get_response(request) | |
File "C:\Python34\lib\site-packages\django\core\handlers\base.py", line 187, in _get_response | |
response = self.process_exception_by_middleware(e, request) | |
File "C:\Python34\lib\site-packages\django\core\handlers\base.py", line 185, in _get_response | |
response = wrapped_callback(request, *callback_args, **callback_kwargs) |
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
improt pandas as pd | |
pd.set_option("display.width", 320) |
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
import selenium | |
import time | |
from selenium import webdriver | |
browser = webdriver.PhantomJS("phantomjs") | |
browser.get("https://twitter.com/StackStatus") | |
print browser.title | |
pause = 3 |
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
from bs4 import BeautifulSoup | |
import requests | |
import re | |
import csv | |
import pickle | |
id_data_list = [] | |
data_csv = [] | |
csv_columns = ['Name','FB ID'] |
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
from bs4 import BeautifulSoup | |
import requests | |
import re | |
import csv | |
import pickle | |
from gevent.pool import Pool | |
id_data_list = [] | |
data_csv = [] |
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
'use strict'; | |
const apiai = require('apiai'); | |
const config = require('./config'); | |
const express = require('express'); | |
const crypto = require('crypto'); | |
const bodyParser = require('body-parser'); | |
const request = require('request'); | |
const app = express(); | |
const uuid = require('uuid'); |
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
import pandas as pd | |
df = pd.read_excel('D:\\BILL THÁNG 1.xlsx') | |
du = df.ix[:, 4] | |
temp_list = [] | |
for cell in du: | |
try: | |
ed = ''.join(cell.split(',')[-1]) | |
print(ed) | |
temp_list.append(ed) |
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
import numpy as np | |
import scipy as sp | |
from numpy import random | |
from numpy import matlib | |
import matplotlib.pyplot as plt | |
from gurobipy import GRB | |
import gurobipy as grb | |
class Problem: |
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
def nearest_neighbours(X, Y, norm=2.0): | |
"""Index the rows of `Y` in increasing order of distance from each row in `X`. | |
Parameters | |
---------- | |
X : array, 2 dimensional, shape = (n_samples, n_dim) | |
The matrix, for the rows of which to find the closest row in `Y`. | |
Y : array, 2 dimensional, shape = (n_reference, n_dim) | |
The matrix, among the rows of which to seek the closest one for `X`. |
OlderNewer