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
console.log('hi'); |
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
curl -v -H "Content-Type: application/json" -d "{ \"first_name\": \"Paul\", \"age\": 26 }" "https://sender.blockspring.com/api_v2/blocks/455dfb41d40d13281ef87e613a669827?api_key=YOUR_API”_KEY |
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 blockspring = require('blockspring'); | |
var d3 = global.d3 = require('d3'); | |
var fs = require('fs'); | |
var cloud = require('d3.layout.cloud'); | |
blockspring.define(function(request, response){ | |
var text = request.params.text, | |
width = request.params.width, | |
height = request.params.height, | |
rotate_words = request.params.rotate_flag, |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 d3 = global.d3 = require('d3'); | |
var cloud = require('d3.layout.cloud'); | |
// Declare inputs and initiate wordcloud draw. | |
(function(){ | |
var text = "SCENE II. Paris. The KING's palace.\n\nFlourish of cornets. Enter the KING of France, with letters, and divers Attendants\nKING\nThe Florentines and Senoys are by the ears;\nHave fought with equal fortune and continue\nA braving war.\nFirst Lord\nSo 'tis reported, sir.\nKING\nNay, 'tis most credible; we here received it\nA certainty, vouch'd from our cousin Austria,\nWith caution that the Florentine will move us\nFor speedy aid; wherein our dearest friend\nPrejudicates the business and would seem\nTo have us make denial.\nFirst Lord\nHis love and wisdom,\nApproved so to your majesty, may plead\nFor amplest credence.\nKING\nHe hath arm'd our answer,\nAnd Florence is denied before he comes:\nYet, for our gentlemen that mean to see\nThe Tuscan service, freely have they leave\nTo stand on either part.\nSecond Lord\nIt well may serve\nA nursery to our gentry, wh |
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
<html> | |
<head> | |
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script> | |
<script src="cloud.js"></script> | |
</head> | |
<body> | |
<script> | |
// Declare inputs and initiate wordcloud draw. | |
(function(){ | |
var text = "SCENE II. Paris. The KING's palace.\n\nFlourish of cornets. Enter the KING of France, with letters, and divers Attendants\nKING\nThe Florentines and Senoys are by the ears;\nHave fought with equal fortune and continue\nA braving war.\nFirst Lord\nSo 'tis reported, sir.\nKING\nNay, 'tis most credible; we here received it\nA certainty, vouch'd from our cousin Austria,\nWith caution that the Florentine will move us\nFor speedy aid; wherein our dearest friend\nPrejudicates the business and would seem\nTo have us make denial.\nFirst Lord\nHis love and wisdom,\nApproved so to your majesty, may plead\nFor amplest credence.\nKING\nHe hath arm'd our answer,\nAnd Florence is denied before he comes:\nYet, for our gentlemen that mean to see\nThe Tuscan service, freely have th |
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
// Word cloud layout by Jason Davies, http://www.jasondavies.com/word-cloud/ | |
// Algorithm due to Jonathan Feinberg, http://static.mrfeinberg.com/bv_ch03.pdf | |
(function() { | |
function cloud() { | |
var size = [256, 256], | |
text = cloudText, | |
font = cloudFont, | |
fontSize = cloudFontSize, | |
fontStyle = cloudFontNormal, | |
fontWeight = cloudFontNormal, |
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 blockspring | |
from fuzzywuzzy import fuzz | |
from fuzzywuzzy import process | |
import os | |
import pandas as pd | |
import numpy as np | |
def block(request, response): | |
primary_ids = [str(row[0]) for row in request.params["proper_ids"]] | |
header_primary_ids = primary_ids.pop(0) |
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 blockspring | |
import urllib | |
from bs4 import BeautifulSoup | |
def block(request, response): | |
sport = request.params["sport"] | |
html = urllib.urlopen("http://www.espn.com/" + sport).read() | |
headlines = [headline.get_text() for headline in BeautifulSoup(html).find(class_="headlines").find_all('li')] |
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
<html> | |
<body> | |
<form accept-charset="UTF-8" action="/scrape" method="post"> | |
<input autofocus="autofocus" placeholder="nba" type="text" name="sport"> | |
<input type="submit" value="Get my headlines!"> | |
<br> | |
</form> | |
</body> | |
</html> |
NewerOlder