GrazrScript Tutorial

Overview

It's all about the feeds

Grazr Corp. was started in June, 2006 with a simple mission: to make sharing of feeds on Web pages as easy as possible. The first step down this path was a powerful tool for sharing feeds on your Web page called Grazr, which made it possible to take any feed file, such as the latest news from Google, and display it in an easy to use interface.


Now, after an intensive development effort, Grazr Corp. has created the next step in the evolution of feed sharing. We are proud to announce GrazrScript!

Build custom Web applications in minutes

GrazrScript is a programming language that dramatically simplifies the creation of Web applications. With GrazrScript you can easily add a custom data entry form to a Web page. This form will allow you to query a remote server, such as a search engine or a media sharing site, and display the results. Creating this type of Web application with traditional Web programming techniques would require you to master a wide range of skills:

  • Script programming with a language like Perl or Ruby
  • CGI programming involving complex permissions and data processing methods
  • Feed programming using an XML parser and matching feed library
  • JavaScript programming to present the form and results on a Web page
  • Ajax techniques to query a remote server with the user's data
  • CSS formatting to display the form and results correctly within all browsers.
GrazrScript reduces Web application development to a few easy steps, all of which you will learn in this short tutorial.

The power of the URL

GrazrScript is based on a simple principle. There are now thousands, perhaps hundreds of thousands of feeds available on the Internet that are based on user queries. These appear within search engines, media sharing sites, job sites, government agencies, etc. The one thing they all have in common is that a user query is placed within a URL, and the results are sent back as a standard feed or OPML file. For example, the following URL will get a feed of Google News items based on a search for "video":

http://news.google.com/news?q=video&output=rss

If you look closely at this URL, you will see that the word "video" is placed after the characters "q=". This is Google's way of saying to search for video. If you change the URL to place another word after "q=", you can search for anything you want. Of course, changing URLs by hand and then reading raw feeds is not the best user interface.

GrazrScript allows you to harness the power of all of these feeds, and publish them on any Web page with a simple to use form and a rich user interface for reading the results. Try typing video into this GrazrScript application and pressing the Enter button.


What you are seeing in action is a GrazrScript application based on a Google query for news. You can look at the program here. The key to GrazrScript's power is that the entire program for this application is just 15 lines in length, almost all of that is the same for every application. In fact, by modifying just one instruction to search in a different URL you can change this application to work with any site that takes a query as a URL and returns a feed.

Free for all

The power behind GrazrScript is the Grazr feed sharing tool that people have come to know and love. Because GrazrScript applications are based on Grazr, all of the heavy lifting is done for you. All you have to do is describe a Web form using simple HTML, and enter a URL that does the query for you. Everything else is built into Grazr. Best of all, Grazr and GrazrScript are completely free. You can build powerful feed-based applications in minutes, publish them on your personal or commercial website for everyone to use, and not pay a penny. Isn't the Web great?

Under Construction

The current version of GrazrScript is a beta test, as is this tutorial. You will see lots of enhancements to GrazrScript over the coming months. The best way to keep up with the changes is to read our blogs and visit our forums.

Draft Specification

You can also read the current specification for GrazrScript. It is a more condensed review of the language syntax.

Sample applications