Posted March 26, 2011 at 9:43 pm by Akshay
I recently started usingĀ snipplr.com to publish small bits of re-usable code with the community. Here’s a quick and dirty basic cURL wrapper function for PHP. cURL wrappers are often needed only when we are working on projects without a CMS or a framework, hence I have tried to keep it very basic. Comments and feedback is welcome.
Posted June 30, 2009 at 1:45 pm by Akshay
Did you know that Google has an officially supported JSON feed of search results? Google half-way cancelled their SOAP API a while ago, but they now offer a parametrized URL that returns a JSON data set. Google says this REST approach is useful for “Flash developers, and those developers that have a need to access the AJAX Search API from other Non-Javascript environments.” This may be even simpler to use than the SOAP API. Here’s an example query:
http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=Paris%20Hilton
This URL format can also be adjusted to grab results from video search, book search and so on. While the URL has the word AJAX in the string and this is officially part of the Google AJAX Search API, this has nothing to do with AJAX per se, as the URL can be called from other environments, including the server side. All you need is a JSON library to parse the results (JSON means JavaScript Object Notation, though it also doesn’t require JavaScript). The Yahoo Search API already utilizes a similar approach, though it can return XML as well. The complete documentation of this Search API can be found on the Developer’s Guide of Google AJAX Search API hosted on Google Code
Posted May 24, 2009 at 11:54 am by Akshay
Web scraping (or Web harvesting, Web data extraction) is a computer software technique of extracting information from websites. Web scraping focuses more on the transformation of unstructured Web content, typically in HTML format, into structured data that can be formatted and displayed or stored and analyzed. Exemplary uses of Web scraping include online price comparison, weather data monitoring, market data tracking, Web content mashup and Web data integration.
Imagine what you can do with all this power in your WordPress blog! Pages and posts can display realtime content from other pages, letting you create a meshup of content. This all is now possible using my WP Web Scraper plugin. Its an easy to implement professional web scrapper for WordPress. This can be used to display real time data from any websites directly into your posts, pages or sidebar. Use this to include real time stock quotes, cricket or soccer scores or any other generic content. The scrapper is built using time tested libraries cURL for scrapping and phpQuery for parsing HTML. Please post all your suggestions and thoughts about this on the WP Web Scraper project page.