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
data <- read.csv("http://docs.google.com/spreadsheet/pub?hl=en_US&hl=en_US&key=0AnhE_6FIbbVWdFNxeS1ESWtvSUk5WE5KcnBwVWVqckE&output=csv", header=FALSE, skip=1, as.is=TRUE) | |
sent <- data.frame(Time=strptime(data[,1], "%H:%M:%S")) | |
library(ggplot2) | |
theme_update(panel.background = theme_rect(fill = "grey90", colour = "black")) | |
xstart <- strptime("01:00:00", "%H:%M:%S") | |
xend <- strptime("23:00:00", "%H:%M:%S") | |
ggplot(sent, aes(Time)) + geom_density(fill="grey50", adjust=0.5) + xlim(xstart, xend) |
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
# the code uses 'facebook' function from the previous gist (https://gist.github.com/1634662) or | |
# see the original http://romainfrancois.blog.free.fr/index.php?post/2012/01/15/Crawling-facebook-with-R | |
# scrape the list of friends | |
friends <- facebook( path="me/friends" , access_token=access_token) | |
# extract Facebook IDs | |
friends.id <- sapply(friends$data, function(x) x$id) | |
# extract names | |
friends.name <- sapply(friends$data, function(x) iconv(x$name,"UTF-8","ASCII//TRANSLIT")) | |
# short names to initials |
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
require(pixmap) | |
# download small profile picture of each friend | |
dir.create("photos") | |
for (i in 1:length(friends.id)) | |
download.file(paste("http://graph.facebook.com", friends.id[i], "picture", sep="/"), | |
destfile=paste("photos/",friends.id[i],".jpg",sep="")) | |
system('for i in `ls photos/*.jpg`; do j=${i%.*}; convert $j.jpg $j.pnm; done', wait=TRUE) | |
# customized node plotting function |
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
# go to 'https://developers.facebook.com/tools/explorer' to get your access token | |
access_token <- "******************* INPUT YOUR ACCESS TOKEN ******************************" | |
require(RCurl) | |
require(rjson) | |
# Facebook json function copied from original (Romain Francois) post | |
facebook <- function( path = "me", access_token, options){ | |
if( !missing(options) ){ | |
options <- sprintf( "?%s", paste( names(options), "=", unlist(options), collapse = "&", sep = "" ) ) |
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
Digging into a Facebook Worm | |
http://i.imgur.com/zc2A8vJ.png | |
Facebook worms are interesting | |
The following was a link that was shared to me (You probably shouldn't click it) | |
https://www.facebook.com/l.php?u=https%3A%2F%2Fcdn.fbsbx.com%2Fhphotos-xpa1%2Fv%2Ft59.2708-21%2F12447002_1746605272238633_1642381431_n.html%2FV1DE0-9682.html%3Foh%3D8a665fb34c8793a92fd02cceb31d4b01%26oe%3D5718116B%26dl%3D1&h=cAQHPcYE7 |
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
#==========================================================# | |
# Visualizing Facebook networks with friend photos # | |
# Katya Ognyanova, www.kateto.net, @ognyanova # | |
#==========================================================# | |
# Find more details at http://bit.ly/fbgephi | |
#==========================================================# | |
#### Collect the data using the RFacebook package #### |
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
<div class="world"></div> | |
<div class="title"> | |
<p>Looking at these waves for 1 minute<br/>will bring you 56% more serenity*</p> | |
<p class="remark">* According to a very serious and reliable study conducted by myself.</p> | |
<div class="credits"> | |
<a href="https://codepen.io/Yakudoo/" target="blank">my other codepens</a> | <a href="https://www.epic.net" target="blank">epic.net</a></div> | |
</div> |
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
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
// MIT license | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; |
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
<canvas id="canvas"></canvas> |
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
<canvas id="canvas" style="position:absolute; top:0; left:0;"></canvas> | |
<div id="buffer" style="display:none;"> |