Showing posts sorted by relevance for query Twitter 411. Sort by date Show all posts
Showing posts sorted by relevance for query Twitter 411. Sort by date Show all posts

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
or
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: http://linkstore.ru/t411/quote.jsp. 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 :
http://linkstore.ru/t411/quote.jsp?t=text
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: http://linkstore.ru/t411/quote.jsp?t=t%20JAVA.

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.

Wednesday, June 15, 2011

How to make a bot for Twitter

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.

411 for Twitter uses Twitter as transport layer. A potential user can follow to @t411 and send direct messages to @t411 or simply post a reply. The responses will come back as replies or 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
or
t LNKD - quote for Linkedin

3. As a processing engine for this bot we've set an URL for JSP file. It is our CGI script for the processing: http://linkstore.ru/t411/quote.jsp. 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 :
http://linkstore.ru/t411/quote.jsp?t=text
Service (daemon) will replace the variable text with the original request. For example, for the following incoming message t ORCL the final request to CGI script will looks so: http://linkstore.ru/t411/quote.jsp?t=t%20ORCL.

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.

Monday, May 28, 2012

Your own bot for Twitter

"...try Twitter 411, a service that lets you create your own custom Twitter bot. The Twitter 411 site contains a directory of public apps that users have already created to handle tasks ranging from checking out the day's weather in London, to getting a quick map to a friend's house, to doing some quick calculations via Twitter. Since all of these apps are available for public use, you can even use a little ingenuity to tie them together to do almost anything through Twitter." - PC World about out 411 for Twitter service.

Friday, June 24, 2011

Twitter: map on demands

One new service for Twitter - map on demands. Based on our Twitter 411 mashup (see more articles about Twitter 411 here).

It is a bot lets you obtain a map for some address. How does it work:

Send to @t411 a reply or direct message in the following format:

   map some_address

  For example:

   map Palo Alto

you will get the response in Twitter (as a reply or direct message too) with the map for the given address. The map will be delivered in the form of the static picture - so you can see it on any mobile phone for example. We are using here the same idea as in our Mobile Maps mashup - Google static maps.

Your comments and suggestions are welcome.

And here you can read the technical details - how to create the similar new bot for Twitter.

Wednesday, March 04, 2009

Twitter: map on demands

One new service for Twitter - map on demands. Based on our Twitter 411 mashup (see more articles about Twitter 411 here).

It is a bot lets you obtain a map for some address. How does it work:

1. Follow to t411
2. Send to t411 a direct message in the following format:

   map some_address

  For example:

   map Palo Alto

you will get the response in Twitter (as a direct message too) with the map for the given address. The map will be delivered in the form of the static picture - so you can see it on any mobile phone for example. We are using here the same idea as in our Mobile Maps mashup - Google static maps.
Your comments and suggestions are welcome.

And here you can read the technical details - how to create the similar new bot for Twitter by your own.

Sunday, March 01, 2009

Twitter SMS

Free SMS provider for Twitter: Twe2. So you can still get direct messages as well as replies via SMS. And by the way it means that with the help of Twitter 411 service you can create a free information service for the mobile (it is a key!) users. So Twitter will play a role of a mobile development platform.
You can find a more about Twitter 411 - bot creator in this blog.

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.

Monday, June 27, 2011

Weather info via Twitter

We wrote already about our Twitter mashup – Twitter 411 service. It is a web application lets you easily create your own Twitter bots. Bot here is an application that receives some requests via Twitter and responds with your own data. You define a form for the request as well as the content for the response. Here is an example for such a bot (stock market).

As a response for the bot within t411 service you can provide any CGI script (e.g. jsp, java servlet, php etc.) on your own site. See again here a complete example (JSP) for stock market bot.

And now let us see a yet another example. Now it is a weather bot.
How does it work? The source data provided by the site yr.no This site contains weather forecast around the world. And what is important, you can pickup weather data in XML or RSS format. So it is a quick deal to build some automation processing. We create a new bot for t411 service – code for the request is w

As a reaction for this bot we've set a JSP file that obtains RSS data from yr.no, presents them in mobile ready form and responds back with a link to the requested forecast. Here is a part of that file:

<div class="content">

<%@ taglib uri="/WEB-INF/taglib374.tld" prefix="w" %>

<w:setLocation url="http://www.yr.no/place/United_Kingdom/England/London/" ttl="36000" id="A"/>

<w:forEachDay feedId="A">

<strong><%=itemTitle%></strong><br/>
<img src="<%=itemImage%>" style="border:0;float:left;padding-right:5px" alt=''/>
<%=itemDescription%><br/><br/>
</w:forEachDay>

<br/>&copy; <w:getChannelCopyright feedId="A"/>
<w:getChannelLink feedId="A" id="url"/>
<br/><a href="<%=url%>">Original data</a><br/>

</div>

code uses the Weather taglib from Coldtags suite. Tag setLocation requests rss feed (and caches it for 10 hours. Tag forEachDay outputs data. And finally we prints a copyright information as well as the back link (as it is required by yr.no)

The rest of the deal is standard. Send to user @t411 a reply or direct message for the weather forecast you are interested in.

Here are examples (what the bot recognizes and what you have to send as reply or direct message to @t411):
w london  get forecast for London
w paris   get forecast for Paris
w msk     get forecast for Moscow
w spb     get forecast for Sankt-Petersburg

And the result (you will get a reply or direct message back) is a link to the mobile site with the forecast. Because it is a mobile site you will be able to open it right from your mobile phone.

The direct messages from Twitter could be delivered by SMS to user's mobile. And so – the mobile link will be delivered too. That was the original idea for t411 service – Twitter could be used as an alternative model for programming SMS services. Twitter is a new transport layer here.

Thursday, July 09, 2009

Twitter bots

We wrote already about our Twitter mashup – Twitter 411 service. It is a web application lets you easily create your own Twitter bots. Bot here is an application that receives some requests via Twitter and responds with your own data. You define a form for the request as well as the content for the response. Here is an example for such a bot (stock market).

As a response for the bot within t411 service you can provide any CGI script (e.g. jsp, java servlet, php etc.) on your own site. See again here a complete example (JSP) for stock market bot.

And now let us see a yet another example. Now it is a weather bot.
How does it work? The source data provided by the site yr.no This site contains weather forecast around the world. And what is important, you can pickup weather data in XML or RSS format. So it is a quick deal to build some automation processing. We create a new bot for t411 service – code for the request is w

As a reaction for this bot we've set a JSP file that obtains RSS data from yr.no, presents them in mobile ready form and responds back with a link to the requested forecast. Here is a part of that file:

<div class="content">

<%@ taglib uri="/WEB-INF/taglib374.tld" prefix="w" %>

<w:setLocation url="http://www.yr.no/place/United_Kingdom/England/London/" ttl="36000" id="A"/>

<w:forEachDay feedId="A">

<strong><%=itemTitle%></strong><br/>
<img src="<%=itemImage%>" style="border:0;float:left;padding-right:5px" alt=''/>
<%=itemDescription%><br/><br/>
</w:forEachDay>

<br/>&copy; <w:getChannelCopyright feedId="A"/>
<w:getChannelLink feedId="A" id="url"/>
<br/><a href="<%=url%>">Original data</a><br/>

</div>

code uses the Weather taglib from Coldtags suite. Tag setLocation requests rss feed (and caches it for 10 hours. Tag forEachDay outputs data. And finally we prints a copyright information as well as the back link (as it is required by yr.no)

The rest of the deal is standard. Follow to user @t411 and send him a direct message for the weather forecast you are interested in.

Here are examples (what the bot recognizes and what you have to send as direct message to @t411):

w london get forecast for London
w paris get forecast for Paris
w msk get forecast for Moscow
w spb get forecast for Sankt-Petersburg

And the result (you will get a direct message back) is a link to the mobile site with the forecast. Because it is a mobile site you will be able to open it right from your mobile phone.

The direct messages from Twitter could be delivered by SMS to user's mobile. And so – the mobile link will be delivered too. That was the original idea for t411 service – Twitter could be used as an alternative model for SMS services programming. Twitter is a transport here.

Monday, June 13, 2011

Messaging server for Twitter

Our mashup for creating information servers on top of Twitter has been updated. Twitter 411 service lets you easily build your own information system that used Twitter as a transport layer. 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 replies or direct messages in Twitter and receive responses as replies and direct messages too. Simply, you can send request with some user defined keywords and get reply with an appropriate response.

It is like old information services with SMS. Send some formatted SMS to service number and get reply. Now you can use Twitter for such kind of services. And @t411 plays a role of "service phone number".

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 send reply or direct message to @t411. Of course, for direct messages you should be mutual friend with @t411, where replies could be used without any restrictions.

Some examples or build-in services:

test - just a test for the service
t stock_ticket. E.g.: t LNKD - 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.

Thursday, June 23, 2011

Twitter talk bot

One interesting feature in Twitter 411 service. This mashup lets users create own programmable Twitter bots. They are so calling messaging bots - so they will respond to direct messages.Service lets you register (reserve) some keywords (words, direct messages started with) and define your own reactions (including your own CGI scripts) for the reserved words in the incoming messages. Here you can see more about building your own information systems on the top of Twitter and how you can easily create your own Twitter bot.

But if you will simply send any reply or DM to Twitter user @t411 and the first word in your message is not reserved for the service you will get answer from the default service - talk robot. Of course, it is not a famous Eliza from J.Veizenbaum, but anyway it can support the conversation, so you can talk. Try to reply to @t411 and talk with the robot.

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 Twitter.com 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

Monday, January 19, 2009

Twitter talk bot

One interesting feature in Twitter 411 service. This mashup lets users create own programmable Twitter bots. They are so calling messaging bots - so they will respond to direct messages.Service lets you register (reserve) some keywords (words, direct messages started with) and define your own reactions (including your own CGI scripts) for the reserved words in the incoming messages. Here you can see more about building your own information systems on the top of Twitter and how you can easily create your own Twitter bot.

But if you will simply send any DM to Twitter user t411 and the first word in your DM is not reserved for the service you will get answer from the default service - talk robot. Of course, it is not a famous Eliza from J.Veizenbaum, but anyway it can support the conversation, so you can talk. Try to send DM to t411 (you must follow to it first, of course) and talk with the robot.

Thursday, March 25, 2010

Twitter taglib

Web-control lets you work with Twitter right from JSP code - Twitter taglib.

Our5 own server-side Twitter mashups (e.g. Twitter 411) use this component.

Wednesday, December 09, 2015

Info-bots in Twitter

Our paper in AINL-FRUCT: Twitter as a transport layer platform

Internet messengers and social networks have become an integral part of modern digital life. We have in mind not only the interaction between individual users but also a variety of applications that exist in these applications. Typically, applications for social networks use the universal login system and rely on data from social networks. Also, such applications are likely to get more traction when they are inside of the big social network like Facebook. At the same time, less attention is paid to communication capabilities of social networks. In this paper, we target Twitter as a messaging system at the first hand. We describe the way information systems can use Twitter as a transport layer for own services. Our work introduces a programmable service called 411 for Twitter, which supports user-defined and application-specific commands through tweets.

Friday, January 15, 2016

Chat bots in Twitter

Namiot D. Twitter as a transport layer platform // Artificial Intelligence and Natural Language and Information Extraction, Social Media and Web Search FRUCT Conference (AINL-ISMW FRUCT), 2015. — Piscataway, NJ, United States: Piscataway, NJ, United States, 2015. — P. 46–51.

Internet messengers and social networks have become an integral part of modern digital life. We have in mind not only the interaction between individual users but also a variety of applications that exist in these applications. Typically, applications for social networks use the universal login system and rely on data from social networks. Also, such applications are likely to get more traction when they are inside of the big social network like Facebook. At the same time, less attention is paid to communication capabilities of social networks. In this paper, we target Twitter as a messaging system at the first hand. We describe the way information systems can use Twitter as a transport layer for own services. Our work introduces a programmable service called 411 for Twitter, which supports user-defined and application-specific commands through tweets

Saturday, June 25, 2011

Calculator in Twitter

A yet another interesting usage for Twitter 411 mashup: Google's calculator, available via Twitter. Just send to @t411 a reply or direct message in the following format:

gc your_request

For example:

gc 100 rubles in dollars

You can use any Google's built-in calculator function.

Thursday, September 24, 2015

Twitter as a transport in information systems

Dmitry Namiot "Twitter as a Transport Layer Platform"

Internet messengers and social networks have become an integral part of modern digital life. We have in mind not only the interaction between individual users but also a variety of applications that exist in these applications. Typically, applications for social networks use the universal login system and rely on data from social networks. Also, such applications are likely to get more traction when they are inside of the big social network like Facebook. At the same time, less attention is paid to communication capabilities of social networks. In this paper, we target Twitter as a messaging system at the first hand. We describe the way information systems can use Twitter as a transport layer for own services. Our work introduces a programmable service called 411 for Twitter, which supports user-defined and application-specific commands through tweets.

Thursday, April 09, 2009

Twitter calculator

A yet another interesting usage for Twitter 411 mashup: Google calculator, available via Twitter. Just send to t411 a direct message in the following format:

gc your_request

For example:

gc 100 rubles in dollars