Skip to content

Instantly share code, notes, and snippets.

View wpgeek922's full-sized avatar

Mohammed Imtiyaz wpgeek922

View GitHub Profile
# coding=UTF-8
from __future__ import division
import nltk
from collections import Counter
# This is a simple tool for adding automatic hashtags into an article title
# Created by Shlomi Babluki
# Sep, 2013
@wpgeek922
wpgeek922 / set_header.php
Created February 17, 2016 06:46
Set headers in file_get_contents() for basic authorization
$strm_context = stream_context_create(array(
'http' => array(
'method' => 'GET', // GET,POST (HTTP METHODS)
'header' => "Authorization: Bearer ACCESS_TOKEN OR API_KEY\r\n"
)
));
$result = file_get_contents(SOURCE_URL, false, $strm_context);
$data = json_decode($result);