- Mac OS X 10.7.4
- デフォルトのruby1.8.7が入っている
- rails 3.0.8を入れてある
- rvmでのインストールを試みたが、はまったので、あきらめた
http://www.oiax.jp/rails/zakkan/rails_3_1_installation_on_macosx.html
| #!/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"; |
| #!/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"; | |
| } |
| <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>'; |
| <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"> |
| <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"> |
| # -*- coding: utf-8 -*- | |
| #バージョンは、Python 2.7.1 | |
| # スカラー | |
| number1 = 3 | |
| number2 = 4 | |
| result = number1 + number2 | |
| print result | |
| # 配列 |
| #perl基礎文法練習(途中) | |
| use strict; | |
| use warnings; | |
| #スカラー | |
| my $number1 = 3; | |
| my $number2 = 4; | |
| my $result = $number1 + $number2; | |
| print $result . "\n"; |
http://www.oiax.jp/rails/zakkan/rails_3_1_installation_on_macosx.html
| # 前提 | |
| # Ruby 1.9.2 |
| # -*- coding: utf-8 -*- | |
| require 'open-uri' | |
| require 'json' | |
| query = "猫 instagr.am" | |
| url = URI.escape("http://search.twitter.com/search.json?q=#{query}&include_entities=true") | |
| res = open(url).read | |
| json = JSON.parse(res) |