Ruby on Rails Web Mashup Projects: A step-by-step tutorial to building web mashups

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

In Detail

A web mashup is a new type of web application that uses data and services from one or more external sources to build entirely new and different web applications. Web mashups usually mash up data and services that are available on the Internet-- freely, commercially, or through other partnership agreements. The external sources that a mashup uses are known as mashup APIs.

This book shows you how to write web mashups using Ruby on Rails-- the new web application development framework. The book has seven real-world projects and each project is described in a methodical step-by-step way, showing how you can write a web mashup from the ground up.

APIs covered in the book

This book covers: Google Maps API, Yahoo geocoding services, Geocoder.us geocoding services, Geocoder.ca geocoding services, Hostip.info, Google Spreadsheet, EditGrid, Clickatell, Interfax, Amazon ECS, Sparklines, Facebook, Indeed, DayLife, Technorati, Futef, WebserviceX Currency Convertor, Weatherbug, Google Bases, Geonames, Flickr, Paypal, Google Calendar, Google Account Authentication, Google Data, and Google Spreadsheet Data.

What you will learn from this book?

You will learn what a mashup application and a mashup plug-in are and how you can effectively use mashup technology to do more than just Web 2.0 startups. You will also learn how to use Ruby and Ruby on Rails to combine, mix, and match up nearly 30 mashup APIs from small to really large scale, and from completely free to commercial to:

  • Map a fleet of kiosks in an online map
  • Send marketing messages through e-mail, SMS, and fax
  • Sell and track the sales of books
  • Search for jobs through a Facebook application
  • Show all sorts of information on a geographic location
  • Buy and pay for movie tickets then post the screening information in an online calendar
  • Apply, approve, and pay for employee expense claims

Approach

This book is project-based. The format of each project is similar, with a statement of the project, discussion of the main protocols involved, an overview of the API, and then complete code for building the project. You will be led methodically through concrete steps to build the mashup, with asides to explain the theory behind the code.

Who this book is written for?

This book is for Ruby on Rails developers who want to expand the features of their site by consuming remote external data and services. Basic knowledge of Ruby on Rails programming is required but you need not have any experience of any of the APIs used.

Author(s): Chang Sau Sheong
Publisher: Packt Publishing
Year: 2008

Language: English
Pages: 270

Ruby on Rails Web Mashup Projects......Page 1
Table of Contents......Page 8
Preface......Page 14
Web mashups......Page 18
Ruby and Ruby on Rails......Page 19
Types of web mashups......Page 20
As a new breed of applications......Page 21
Innovate and create extra value for your application......Page 22
Things to watch out for when doing web mashups......Page 23
Commercial dependency......Page 24
Losing your users......Page 25
How this book works......Page 26
What we will be doing......Page 27
Ready?......Page 28
Building a kiosk locator feature for your site......Page 30
Mashup APIs on the menu......Page 31
Geocoder.ca......Page 32
GeoKit......Page 33
Configuring evironment.rb......Page 34
What we will be doing......Page 36
Configuring database access and creating the database......Page 37
Creating scaffolding for the project......Page 38
Bulk adding of longitude and latitude......Page 39
Adding longitude and latitude during kiosk creation entry......Page 41
Creating the find closest feature......Page 42
Displaying kiosks on Google Maps......Page 44
Summary......Page 49
Building a proxy mailing list feature for your website......Page 50
Requirements overview......Page 51
Send messages......Page 52
Sending SMS messages......Page 53
Sending fax messages......Page 54
Google Spreadsheets......Page 55
EditGrid......Page 56
Clickatell......Page 57
Interfax......Page 62
Net::HTTP......Page 64
Creating a new Rails project......Page 65
Creating standard scaffolding......Page 66
Allowing the marketing people to create the message templates......Page 67
Allowing the reseller to provide contacts data through a remote link......Page 68
Uploading to and publishing from Google Spreadsheets......Page 69
Uploading to and publishing from EditGrid......Page 74
Creating the rake script to send messages at regular intervals......Page 76
Parsing data from the online spreadsheet......Page 82
Sending a fax with Interfax......Page 83
Sending an SMS through Clickatell......Page 84
Sending an email through ActionMailer......Page 87
Customizing text messages according to the individual recipient......Page 89
Summary......Page 90
Requirements overview......Page 92
Track sales ranking with a chart......Page 93
Amazon E-Commerce Services API......Page 94
Amazon ECS Ruby library......Page 95
What we will be doing......Page 96
Creating a new Rails project......Page 97
Creating the Amazon Rails library......Page 98
Creating the sidebar......Page 101
Getting customer reviews......Page 104
Getting the daily sales ranking......Page 107
Displaying the sales ranking sparkline......Page 108
Creating a shopping cart......Page 110
Adding similar books to the shopping cart......Page 114
Summary......Page 116
Job board......Page 118
Design......Page 119
Facebook Platform......Page 120
Indeed......Page 121
Daylife......Page 122
XmlSimple......Page 123
Acquire candidates through Facebook......Page 125
Acquiring candidates through Facebook......Page 126
Creating a Facebook application......Page 127
Installing and configuring RFacebook......Page 128
Extracting the Facebook user profile......Page 129
Displaying the user profile and creating the search form......Page 131
Deploying and configuring the Facebook application......Page 133
Creating the search action......Page 138
Parsing and displaying the search results......Page 139
Displaying the location of the jobs on the map......Page 140
Creating a link on each job to show the news and blog articles......Page 143
Searching for news on the company......Page 145
Searching for blog entries on the company......Page 147
Summary......Page 148
Requirements overview......Page 150
Mashup APIs on the menu......Page 151
WebserviceX Currency Converter......Page 152
WeatherBug......Page 153
Flickr......Page 154
Hostip.info......Page 155
What we will be doing......Page 156
Creating the basic Location object......Page 157
Creating a search form......Page 162
Creating the online map......Page 163
Creating the tabs for the information......Page 164
Getting information from Wikipedia......Page 168
Getting places information......Page 169
Getting hotel information......Page 173
Getting weather information......Page 177
Displaying pictures of the location......Page 181
Showing currency exchange rate......Page 184
Showing remote location time compared with local time......Page 192
Showing nice exception pages......Page 195
Summary......Page 196
Online event ticketing......Page 198
Design......Page 199
Website Payment Pro......Page 200
PayPal Sandbox......Page 201
Google Calendar......Page 203
What we will be doing......Page 204
Creating the flow for the ticketing application......Page 205
Integrating with PayPal for payment......Page 220
Integrating with Google Calendar......Page 224
Integrating with Clickatell......Page 226
Summary......Page 227
Salary and expense claims......Page 228
Design......Page 229
Mass Payment......Page 230
Google Data APIs......Page 231
Acts_as_state_machine plugin......Page 232
What we will be doing......Page 233
Setting up the database......Page 234
Modifying Payment and creatomg subclasses......Page 235
Creating the Google API access library......Page 236
Creating the expense claims parsing rake script......Page 253
Creating the mass payment rake script......Page 255
Modifying the Payment and Claim Item controllers......Page 256
How it works all together......Page 258
Summary......Page 264
Index......Page 266