Saturday, December 27, 2008

Twitter location

Extending our Twitter related tootls series (see for example Twitter 411) - a new mashup is ready: Twitter location. If you are authorized on than you can set your location right from the Google Maps. Just click on the map and update your status in Twitter. Technically it is a Google Maps API (reverse geocoding) - similarly to the Geo Search

Thursday, December 25, 2008

Annotated links - REST API

The mashup Annotated links supports REST API too. So you can pack together some URL and comment right from your own application. Actually even JavaScript is enough here - the service can return JSON. Details for REST API are here.

Monday, December 22, 2008

Annotated links bookmarklet

An useful add-on to our Annotated links mashup - Annotation bookmarklet. Lets you add an annotation for the current url (it will create an annotation with the URL of the page you are viewing).

Add annotation

If you are using Internet Explorer, just right click on the link, and select Add to Favorites and save it to the Links folder. If you are using Firefox, right click the link and select Bookmark This Link and save it to the Bookmark Toolbar Folder.

More bookmarklets see here.

Saturday, December 20, 2008

Annotated links - 3

A small mashup lets you create annotated links. Provide an URL (list of URL's), add a text note and get one tiny URL for the whole pack. So you can publish annotated links on your site for example. Annotated link could be shared via email, twitter or facebook.

as a part of the upcoming API you can use mashup in the following form too:

E.g. for this blog:

So the well known site's feature 'share url' could be implemented with the above mentioned type of link. Now the users will be able to share the link itself and own comments too.

See it here - Annotated links.

Friday, December 12, 2008

Outlook taglib

A long time bug with CSS "features" of IE caused problems with Outlook taglib has been fixed. So you are welcome to check out the updated version:

Meeting 1
Meeting 2
Review for new components
in Coldtags suite

Wednesday, December 10, 2008

How to make a Twitter bot

Twitter bot is an application that automatically responds to users requests. It could be done in Twitter either via @reply postings or via direct messages. Here we will show how to use Twitter 411 service for your own bots creation. E.g. you can create there your own information system for the business or private purposes.

Twitter 411 uses direct messages transport. A potential user can follow to t411 and send direct messages to t411. The replies (responses) will come back as direct messages too. And users of Twitter 411 service define how to proceed requests. They can reserve some keywords as well as associated rules described how to proceed messages starting with that keyword.

As a method of message processing service users can choose an URL for some CGI script. This script will be responsible for the processing the incoming messages and producing the responses. Twitter 411 service works in this case as a daemon: gets a message, passes it to the appropriate CGI script, reads the response and sends it back. Let us see how does it looks like practically. Service Twitter 411 includes build-in bot lets you request stock quotes. Let us see its internals:

1. We've registered a keyword t (just a letter t). So all the direct messages starting with t (t will be processed by this bot.

2. Our bot expects messages in the following format t stock_symbol for getting the quote. For example:
t ORCL - quote for Oracle
t JAVA - quote for Sun

3. As a processing ngine for this bot we've set an URL for JSP file. It is our CGI script for the processing: For this bot our processing will be placed on the same server, but of course you can provide your own URL for any available server.

4. We can instruct Twitter 411 (our daemon) pass the whole incoming message to our CGI script. So in service's GUI we've set actually the following URL :
Service (daemon) will replace the variable text with the original request. For example, for the following incoming message t JAVA the final request to CGI script will looks so:

Now let us see the script itself. In our case it is JSP file expecting requests with the parameter t. And parameter's value will be in the following form t stock_symbol. So, our script (JSP file) will read parameter's value, extract stock symbol (part of the string after the space), request quote and print the result. It is all. For example:

<%@ page contentType="text/plain; charset=utf-8" %>
<%@ taglib uri="taglib27.tld" prefix="get" %>

String t = request.getParameter("t");
if (t==null)
{ out.println("unknown");
return; }

// the pattern is: t <space> stock_symbol

int i = t.indexOf(" ");

if (i<=0)
{ out.println(t+"?? could not get ticket");
return; }

t = t.substring(i+1).trim();

<get:Quote symbol="<%=t.toUpperCase()%>" id="A" />

<%=A.get(0)+": "+A.get(1)+" "+A.get(9)%>

Here our JSP file prints the quote and its chart (we've used custom tags from Coldtags suite)

In other words - all what do you need for your own Twitter bot is just an ordinary CGI script with your own processing. You can program your own script, reuse something existing component etc. And your Twitter bot could be placed on any web server with CGI scripts support.

Sunday, December 07, 2008

YouTube downloading

A new component in Coldtags suite - YouTube taglib lets you download video right from JSP pages. Just provide a link for the existing page on YouTube and get back URL for Video downloading.

Monday, December 01, 2008

Information server on top of Twitter

Open API from Twitter is a good base for many mashups uses Twitter's data. Here is another idea - information server on the top of Twitter. Twitter 411 service lets you easily build your own information system, uses Twitter as a transport. The idea is very transparent. You can define your own keywords as well as data, associated with the selected keywords. Users will ask service via direct messages in Twitter and receive responses as direct messages too. Direct messages for the requests are just user-defined keywords. Direct messages for the responses are just user-defined reactions (data associated with the keywords).

User defined responses could be provided as some texts (of course, the keyword owner will be able to change/update the text any time) or (what is more interesting) as URL's for the external CGI scripts. So you can reserve a keyword and provide your own CGI script for the responses. The engine simply calls this URL in order to get the response. And the text of the original request could be passed as HTTP parameter.

The usage for this service is transparent. Just follow to t411 in your Twitter and send direct messages to t411 with your requests.

Some examples or build-in services:

test - just a test for the service
t stock_ticket. E.g.: t JAVA - returns price for the ticket. This service uses an external CGI script for getting quotes.

And by the way, it is automatically a mobile service too.

Technically, mashup uses appropriate components (including Twitter taglib) from Coldtags suite.