Skip to content

Instantly share code, notes, and snippets.

@raulgarreta
raulgarreta / get_followers_bios.py
Created October 3, 2016 06:44
Simple Python command to get Twitter user followers with the public API.
# -*- coding: utf-8 -*-
import csv
import time
import re
import codecs, cStringIO
from argparse import ArgumentParser
import tweepy
@raulgarreta
raulgarreta / keywords_csv.py
Last active March 8, 2017 22:36
Simple Python command to extract aggregated keywords from a list of texts in a CSV file column.
# -*- coding: utf-8 -*-
import csv
import codecs, cStringIO
from argparse import ArgumentParser
from monkeylearn import MonkeyLearn
class UTF8Recoder:
"""
import requests
import json
data = {
'text_list': ["This is a text to try language detection.",
"This is some more text"]
}
response = requests.post(
"https://api.monkeylearn.com/v2/classifiers/cl_oJNMkt2V/classify/",
@raulgarreta
raulgarreta / gist:2f74ef00e733349052c1
Created February 10, 2015 16:32
MonkeyLearn & Import.io webinar
import json
import pandas as pd
import requests
# Your API key goes here.
API_KEY = ''
raw_df = pd.read_csv('linkedin-sf.csv', encoding='utf-8', skiprows=1,
error_bad_lines=False)
@raulgarreta
raulgarreta / gist:891d185dce1cc23974c5
Created September 7, 2014 09:07
monkeylearn java
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.io.DataOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;
import java.lang.StringBuffer;
public class App