OSC2007-niigata - mashup

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    4 Favorites

    OSC2007-niigata - mashup - Presentation Transcript

    1. ↓Macbook pro
    2. ↓Macbook pro Not
    3. 1
    4. Rails
    5. Mashup
    6. Mashup
    7. Remix
    8. Remix
    9. Mashup
    10. Mashup
    11. Mashup
    12. HTML
    13. API
    14. Web2.0
    15. WebAPI
    16. WebAPI
    17. 3
    18. RSS Amazon Web Service Google net
    19. →MP3
    20. Google Maps NIFTY Timeline API
    21. API MVC M V
    22. Controller
    23. PHP, Perl, Ruby, Java....
    24. PHP
    25. Ruby on Rails
    26. Web2.0
    27. WebAPI ActiveResource
    28. Rails2.0
    29. Rails2.0
    30. ActiveResource
    31. Rails Rails
    32. Mashup
    33. OSC-Do blog
    34. WebAPI
    35. API
    36. API
    37. API URL
    38. http://jws.jalan.net/APICommon/ OnsenSearch/V1/? key=**********&l_area=010802 &count=1&xml_ptn=1
    39. XML
    40. Rails
    41. require 'net/http' require 'cgi' require 'rexml/document' class Onsen attr_accessor :address, :name, :id KEY = 'phe11375af71ba' URL = 'http://jws.jalan.net/APICommon/OnsenSearch/V1/?' def self.find(params) results = [] get(params).elements.each('Results/Onsen') do |el| results << Onsen.new(el.elements[\"OnsenID\"].text, el.elements[\"OnsenName\"].text, el.elements[\"OnsenAddress\"].text) end results end def self.url(params) params[:key] = KEY URI.parse(URL+((params.map { |key,value| \"#{key}=#{CGI::escape(value.to_s)}\"}).join('&'))) end def self.get(params) REXML::Document.new(Net::HTTP.get(url(params))) end def initialize(id, name, address) @id, @name, @address = id, name, address end end
    42. API
    43. Web
    44. irb> puts Onsen.find(:count => 10, :pref => '170000').map{|o| o.name}.join(',') => , , , , , , , , , ( )
    45. Google Map
    46. Ruby
    47. YM4R/GM
    48. GoogleMaps API Rails
    49. $ rails onsen -d sqlite3 $ cd onsen $ script/plugin install \\ svn://rubyforge.org/var/svn/ym4r/Plugins/GM/trunk/ym4r_gm $ ./script/generate controller onsen index
    50. Onsen lib/onsen.rb
    51. class OnsenController < ApplicationController def index @map = GMap.new(\"map_div\") @map.control_init :large_map => true, :map_type => true @map.center_zoom_init([37.60988,138.872681], 10) end end
    52. <html> <head> <%= GMap.header %> <%= @map.to_html %> </head> <body> <%= @map.div(:width => 600, :height => 400) %> </body> </html>
    53. Google Maps
    54. API
    55. Google Maps API
    56. YM4R/GM
    57. irb> nigata = Geocoding.get(‘ ’) irb> nigata.first.latlon => [37.912016, 139.061847]
    58. Onsen
    59. class Onsen def latlon Geocoding.get(@address).first.latlon end end
    60. Google
    61. class Onsen def latlon Geocoding.get(@address.gsub(/( | | ).{1,5} /,'¥¥1')).first.latlon end end
    62. 2 API Mashup
    63. class OnsenController < ApplicationController def index @map = GMap.new(\"map_div\") @map.control_init(:large_map => true, :map_type => true) @map.center_zoom_init([37.60988,138.872681], 8) return Onsen.find(:count => 30, :pref => '170000').each do |o| begin marker = GMarker.new( o.latlon, :title => o.name, :info_window => render_to_string( :partial => 'point', :locals => { :onsen => o }) ) @map.overlay_init(marker) rescue end end end
    64. HTML
    65. <div><strong><%=h onsen.name %></strong></div> <div><%=h onsen.address %></div>
    66. Flickr
    67. WebAPI
    68. Ruby
    69. API
    70. Yahoo Web
    71. http://api.search.yahoo.co.jp/ ImageSearchService/V1/ imageSearch? appid=YahooDemo&results=1& query=
    72. Onsen
    73. class Onsen def photo Onsen.get({ :appid=>'onsen', :query=>@name.gsub(/ ¥(.*/,''), :results => 1}, \"http://api.searc........rch?\" ).elements['/ResultSet/Result/Thumbnail/ Url'].text end end
    74. <div><strong><%=h onsen.name %></strong></div> <div><%=h onsen.address %></div> <div style=\"height: 120px\"> <%= image_tag(onsen.photo) rescue 'No photo' %> </div>
    75. acts_as_commentable
    76. jpmobile
    77. http://blog.masuidrive.jp/

    + masuidrivemasuidrive, 3 years ago

    custom

    3120 views, 4 favs, 3 embeds more stats

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 3120
      • 2738 on SlideShare
      • 382 from embeds
    • Comments 0
    • Favorites 4
    • Downloads 91
    Most viewed embeds
    • 380 views on http://blog.masuidrive.jp
    • 1 views on http://rss.nis.nec.co.jp
    • 1 views on http://72.14.235.104

    more

    All embeds
    • 380 views on http://blog.masuidrive.jp
    • 1 views on http://rss.nis.nec.co.jp
    • 1 views on http://72.14.235.104

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories