Active Youtube


ActiveYoutube is a gem to access YouTube API using ActiveResource. This gem wraps code from our previous post on extending ActiveResource to access YouTube. There have been minor changes, which are :
  1. Namespace in class names: Video, User, StandardFeed and Playlist classes have been moved to "Youtube" module, to prevent any conflicts with your ActiveRecord models.
  2. CustomMethods related change: In last version, only response from "find" was converting "entry" object to array of "entry" object. Now, the same behavior is implemented for custom http calls like Video.find().get(:comments)
  3. Small patch for better namespacing: Its basically some code from the rails trunk on ActiveResource, for better handling of namespaces while creating ActiveResource objects.

Gem Installation:

1
2

sudo gem install active_youtube

Example Usage:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

#### Video
  ## search for videos on 'ruby'
  search = Youtube::Video.find(:first, :params => {:vq => 'ruby', :"max-results" => '5'})
  puts search.entry.length

  ## video information of id = ZTUVgYoeN_o
  vid = Youtube::Video.find("ZTUVgYoeN_o")
  puts vid.group.content[0].url

  ## video comments
  comments = Youtube::Video.find_custom("ZTUVgYoeN_o").get(:comments)
  puts comments.entry[0].link[2].href

  ## searching with category/tags
  results = Youtube::Video.search_by_tags("Comedy")
  puts results[0].entry[0].title

#### STANDARDFEED
  ## retrieving standard feeds
  most_viewed = Youtube::Standardfeed.find(:most_viewed, :params => {:time => 'today'})
  puts most_viewed.entry[0].group.content[0].url

#### USER
  ## user's profile - guthrie
  user_profile = Youtube::User.find("guthrie")
  puts user_profile.link[1].href

#### PLAYLIST
  ## get playlist - multiple elements in playlist
  playlist = Youtube::Playlist.find("EBF5D6DC4589D7B7")
  puts playlist.entry[0].group.content[0].url
Filed in our tools ruby
Tagged as    
Posted on 12 February
156 comment Bookmark   AddThis Social Bookmark Button Updated on 25 June

Quarkshop : next-generation shopping



QuarkShop is a next-generation shopping experience to find product of your choice based on opinions across the Internet. You give your preference and Quarkshop will fetch the best matched products for YOU.

For launch, currently we have following products :

Search products

You can give your preference by selecting features you LIKE and we will find the best matched products. Selection of preference can be used along with other navigation parameters like brand, price, etc. These features are automatically extracted from reviews.

Then click submit, and you will see the three best matched products with their most related information. There is also an option to see more products. But we think that top 3 products is what consumer care about after they have given their preference, this makes searching for products simple and fast.


Choose your features



Top 3 products

Comparison : QuarkGraph

You can compare the top three products on the spot!. When you click on Compare Top Three button, you will see QuarkGraph, the graphical comparison showing scores of feature for each product. The graph is just not an image but you can play with it.

Features & Snippets : Voice of consumer

Features are keywords that are reviewed in a review. When you read a review you are always looking for such keywords and people's comment about this keywords. Quarkshop gives an option to choose features/keywords that you like and it will give you the best matched products. You can also read sentence from actual reviews giving opinion on keywords (Snippets).

Feedback

We would really appreciate if you could give your feedback. It would help us to know where we stand and what is required to make useful shopping experience.
Filed in our tools quarkrank
Tagged as   
Posted on 19 December
3 comment Bookmark   AddThis Social Bookmark Button Updated on 23 February

introducing QuarkRank



We're back to blogging after taking a leave for more than a month. We have been very busy developing QuarkRank, a summarized reviews repository. It is a result of more than 18 months of dedicated research on Natural language processing, HTML Scrapping and User interface. Finally, we are happy to make this product live!!!

Currently, the repository is accessible using RESTful API or Widget. Moreover, its absolutely free!

About QuarkRank

"From product reviews, restaurant reviews, hotel reviews, to others, QuarkRank provides the information for making decisions at the point of purchase. Proprietary technology lies at the core of QuarkRank's ability to automatically summarize the opinions of millions of consumer reviews on the internet."

QuarkRank is an intelligent engine which crawls the web for opinions on various products/services and automatically summarize them feature-by-feature using its natural language processing technique.




Best and worst of Apple Ipod Touch 8gb
QuarkGraph: QuarkRank data displayed using amcharts at Quarkshop


QuarkRank will help consumers to quickly educate themselves, based on the most unbiased information possible, without spending hours reading review online.

If you use QuarkRank data, your customers will feel confident in making purchase decision at your site, without going to competitors, and at the same time reducing the return rate of impulse purchases.

QuarkRank provides

  • Reviews gathered and combined at one place! for various products and services.
  • QuarkRank, no. of reviews for a product/service
  • Top 5 feature, Worst 3 feature, All features that people talk about a product/service. For example : sound quality, design, screen of a Mp3 player.
  • Feature score, buzz and SNIPPETS from reviews which have opinion about a feature.

No need to waste time analyzing reviews at Cnet and Amazon anymore!

Where can you use it?

  • Boost online shopping experience of your users.
    • Best and Worst about a product.
    • Graphical feature-by-feature comparison.
    • Power your navigation by giving feature as an option to choose.
    • Summarized form of reviews.
  • Add product widget to your blog/article.
  • On your social profile, add widget of your favourite or owned products.
  • Show feature-by-feature opinions and comparison for products at your retail store.

API

QuarkRank provides a RESTful API to access our huge repository of summarized reviews. Send us simple HTTP requests and it will send back basic XML responses, which means you can interact with our API from any language.

It provides data in XML and JSON format. There is no limit is using the api. For detailed information, visit : ActiveResource can be used to access QuarkRank's RESTful API in Ruby on Rails. Note : You need to apply this tiny patch to ActiveResource.
ActiveResource code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class Product < ActiveResource::Base
  self.site = "http://username:password@quarkrank.com"

  def self.list options={:category=>"camera"}
    find(:all, :params=>options)
  end

  def self.show sku, site=nil, all_features=false
    params = {}
    params[:site] = site unless site.nil?
    params[:all_features]="true" if all_features
    find(sku, :params=>params)
  end

  def self.search query
    find(:all,:params=>{:search=>query})
  end

end

class Snippet < ActiveResource::Base
  self.site = "http://username:password@www.quarkrank.com/products/:product_id"

  def self.snippets product, name
    find name.gsub(" ","%20"),:params=>{:product_id=>product}
  end
end

Widget

QuarkRank provides two kinds of customizable widget.
  1. Top 5 features
  2. Interactive widget for features and review snippets of a product

More informatin at:

Technologies and tools used

A lot of them ....
  • HTML scrapping : NLP, Scrapi, Firequark, CSS Selectors. Implemented in Ruby.
  • Text-mining : Statistics, Text parsing, chunking, cleaning and many enhancements.
  • API and QuarkRank site : Ruby on Rails, REST, Acts_as_solr, Request routing.

Coming next

QuarkShop : a mashup of QuarkRank, Cnet, Amazon, Shopping.com and Yahoo.com.
Filed in our tools quarkrank
Posted on 17 December
1 comment Bookmark   AddThis Social Bookmark Button Updated on 18 September

Firequark : quick html screen scraping



Table of Contents
  1. Introduction
  2. Why Firequark?
    1. XPath vs. CSS Selector
    2. Find CSS Selector manually
    3. Bundle Scraping
  3. Usage - screencast
  4. Installation
  5. Documentation
  6. Todo

Firequark is an extension to Firebug to aid the process of HTML Screen Scraping. Firequark automatically extracts css selector for a single or multiple html node(s) from a web page using Firebug (a web development plugin for Firefox). The css selector generated can be given as an input to html screen scrapers like Scrapi to extract information. Firequark is built to unleash the power of css selector for use of html screen scraping.

HTML screen scraping is a common technique of extracting information about specific and useful elements from a web page. Independent of programming language, for extracting an element from a web page one need to know its exact location or a key to uniquely identify the element. There are two approaches for uniquely identifying an element: using XPath or CSS Selectors.

Firebug has an inbuilt functionality of generating XPath for an html element. Ilya Grigorik has written a good article on using XPath for HTML screen scraping. Whereas, Firequark extends Firebug for generating CSS Selector for elements on a web page.

Example case : Lets take a practical example where you want to scrape Amazon.com. My goal is to get product name, price and rating for all the products from the Amazon point-and-shoot camera catalog page. I will use this example in screencast and explanation below.

Filed in our tools
Posted on 05 September
226 comment Bookmark   AddThis Social Bookmark Button Updated on 15 June

QScraper : hpricot interface to scrapi


QScraper is a wrapper over scrapi to provide Hpricot like interface.

Motivation: Hpricot interface is simple and easy to use while scrapi is more powerful because of bundle scraping and anonymous classes. I was using hpricot for quick testing and checking but scrapi for project implementation. To avoid working with two html scrapers, I wrote this wrapper over scrapi.

Bundle Scraping: It refers to extraction of multiple attributes of an element from a web page in a single parse. Most screen scraping tools extract only multiple elements but not multiple attributes of an element. Lets take an example of blog scraping, each blog post would be an element and I would like to extract multiple attributes of blog post like info about author, published on, title and content. Rather than making individual calls like doc.search(author_selector), doc.search(published_selector) etc., I would like to do doc.find(author_selector, date_selector, title ...).

Filed in our tools ruby
Tagged as   
Posted on 23 August
0 comment Bookmark   AddThis Social Bookmark Button Updated on 05 November