Integrate Google Search Appliance with Rails Application - ruby-on-rails

I wanted to integrate GSA with Rails. But the web proved to be un-helpful. Anybody knows any step-by-step tutorial.

First, you have to call the GSA with the search query. The reference informations for generating the GET-request is here: http://code.google.com/apis/searchappliance/documentation/610/xml_reference.html#SubmittingaSearchRequest
Then you will receive a xml response from the GSA with all needed information inside. The reference for the xml nodes are here (Look better at a xml response from your GSA and get additional informations in my link): http://code.google.com/apis/searchappliance/documentation/610/xml_reference.html#results_xml_tags
Last but not least, you have to parse the informations within the xml and generate your custom frontend.
I hope that will help you. It isn't really complicated.

Define "integrate" closer. The most things are language independent and have nothing to do with Rails/Java/.Net or whatever

Try using the gem rails-gsa this will help you a lot in integrating the Google Search Appliance with your rails Application.
Check out the documentation on github https://github.com/rohit9889/rails-gsa

Related

rails : how can i integerate expedia api to sample app with no database?

i would like to know how to integerate expedia api in a sample app with zero database such that it should have a functionality to improve search function and enable anyone to pull from the Expedia to provide a comprehensive search based on the keyword entered like in the link
-something similar to www.helloweekends.com. When you run a search on their site, the results in the dropdown are broken down into three sections. how to do this ?
there is a gem expedia which will help you a lot
this will help with the first part of your question (a rails app with no activerecord)
You could have a search method that uses an http library like HTTParty to take the input from your user, make the same call to other services, get the the results, and aggregate them in your search method as you see fit.

What is Twitter API?

I would like to apologize first if the question is a total newbie question, but I really am a total newbie on this.
I'm a student and I recently have joined a project that involves studying (mining) tweets. The project head asked me to use the Twitter API to extract tweets. What exactly is Twitter API and how can I use it? What do I need to know to start using it?
Twitter allows you to interact with its data ie tweets & several attributes about tweets using Twitter APIs. You'd need to know a server side scripting language like php, python or ruby to make requests to twitter api and results would be in JSON format that can be easily read by your program.
A good starting point would be reading the official documentation at https://dev.twitter.com/ itself.
Throw you can use and show some functionality in your website

crawling 3 websites using grails

hi i am trying to build a simple application using grails wherein i need to crawl 3 websites to get data abt the price off the book.And after getting those details when i select to buy it has to redirect to tht selected site.example refer the link http://www.mydiscountbay.com/ I am stuck i dont know hw to implement a simple crawler in grails.pls guide me with a sample code or tutorial on hw to implement it
thanks in advance
Implementing crawler has nothing to do with grails, there are some opensource java crawlers that you may be able to use or customize as per your need. Front end part would be like a normal grails web app.
Using something like URL#getText() will not get you very far with webs that have redirections, cookies, etc.
For anything even a little bit involved, use commons HttpClient, or the groovy HttpBuilder.
http://hc.apache.org/httpcomponents-client-ga/index.html
http://groovy.codehaus.org/HTTP+Builder
To parse the response and extract content, use XmlSlurper, eg: Using XmlSlurper: How to select sub-elements while iterating over a GPathResult

Follow and Scrape Links In Tweets with Rails

I'm currently parsing twitter feeds through my rails app and wondering how it would be possible to follow links in the tweets and scrape the external content (for example, if the tweet contains a link to an article on TechCrunch, follow that link to the article and scrape the title and body content of the article). Flipboard for iPad is a perfect example of this.
I'm familiar with screen scraping using Nokogirl / Mechanize, but trying to figure out how to accomplish this in a way it could work regardless of where the link in the tweet is linking to (whether it be to TechCrunch, or Flickr, etc...).
Any thoughts / insights would be much appreciated!
Many of the major content providers provide a oembed endpoints. Take a look at the oembed_links gem. From the readme:
It allows you to easily parse text and
query configured providers for embedding information on the links
inside the text. A sample configuration file for configuring the
library has been included (oembed_links_example.yml), though you
may also configure the library programmatically (see rdocs).
If you use oembed_links in conjuction with http://oohembed.com/ you'll have dozens of content providers handled for you. You can easily write a custom provider to handle the rest.

Trackback implementation: rel="trackback" vs RDF

I want my Rails App to parse external websites for a trackback URL but I'm not really sure if I should just look for a
Text
or follow the RDF specifications described by sixapart. Or both. Wordpress and Techcrunch both only offer a rel="trackback" link and they should know. On the other hand maybe some blog only provides RDF and I'm missing the link.
What do you think?
And is there any ready gem/plugin out there (it's really hard to google for trackback...)
Thanks.
UPDATE
I'm now first trying to find the RDF information. If I do not find anything, I look for the link tag. I was refering to the sixapart specifications. Thanks for your help.
I'm checking for both now (first RDF, then link if not successfull). I was refering to the sixapart specifications. Thanks for your help!

Resources