Skip to content

Instantly share code, notes, and snippets.

View maeharin's full-sized avatar

Hidenori Maehara maeharin

View GitHub Profile
@maeharin
maeharin / show_fb_picture.html
Created April 22, 2012 14:32
show picture of another gender facebook friends (javascript.jQuery)
<html lang="ja">
<head>
<script src="http://connect.facebook.net/ja_JP/all.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
</head>
<body>
<div id="start_section"></div>
<div id="friend_section"></div>
<div id="fb-root"></div>
<script type="text/javascript">
@maeharin
maeharin / show_fb_public_info.html
Created April 22, 2012 13:58
show facebook user's public information (javascript/jQuery)
<html>
<div id="hoge"></div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>
var user_id = 'zuck'; //facebook id
var url = 'https://graph.facebook.com/' + user_id + '?callback=?';
var additional_html;
$.getJSON(url, function (res) {
for(var i in res) {
additional_html += i + ':' + res[i] + '<br>';
@maeharin
maeharin / cmd_yahoo.php
Created April 20, 2012 03:25
view yahoo japan daily news at command line (written by PHP)
#!/usr/local/bin/php
<?php
$url = 'http://rss.dailynews.yahoo.co.jp/fc/rss.xml';
$rss = simplexml_load_file($url);
foreach ($rss->channel->item as $v) {
echo $v->title . "\n";
}
@maeharin
maeharin / cmd_twitter.php
Created April 20, 2012 03:13
view twitter time line at command line (witten by php)
#!/usr/local/bin/php
<?php
$user_id = $argv[1];
if ($user_id) {
$url = 'https://twitter.com/statuses/user_timeline.json?id=' . $user_id;
$tweet = file_get_contents($url);
$tweet = json_decode($tweet);
foreach($tweet as $v) {
echo $v->text . "\n";