Adding presence-based and location-based capabilities in Twitter by Mugdha Jamsandekar Priyanka Prabhu Neha Sugandh 1|Page INDEX __________________________________________________________ No. 1 2 3 4 5 6 7 8 9 10 11 12 Title Introduction Twitter Related Work Objectives Architecture Diagram Flow Chart Technologies Used Implementation Details Screen Shots Conclusion Future Work References Page No. 3 4 5 6 7 8 10 11 14 19 21 22 Introduction ______________________________________________________________________________ 2|Page In the recent years, social networking applications have become very popular. Websites like Facebook, Orkut etc. allow people to stay in touch with each other even when they may be far away. In spite of having methods like e-mail, social networking has become very popular. Social networking websites provide a place where people can virtually see their friends and talk to them (and in some websites they can also read their conversations with other people). One of the reasons for their popularity is that man is a social animal and they like to be informed about the happenings in the lives of their friends. One of the successful social networking applications is twitter where people can send short update to their friends. They can send updates which include what they are doing at a particular point of time or how they are feeling. It is primarily focused on giving people short updates about their day to day lives rather than enabling conversations between people. Twitter basically provides the information about what a person is doing at a particular point of time. Our intuition is that people will also be interested to know where their friends are at a particular time and whether they are available for communication through an more conversational medium. The chosen conversational medium will also depend upon the person's location, for example, different mediums would be preferable in an office as compared to home. Thus, we add location-based and presencebased capabilities to Twitter in our project. Twitter ______________________________________________________________________________ Twitter is a free social networking and micro-blogging service that allows users to 3|Page send "updates" (or "tweets"; text-based posts, up to 140 characters long) to the Twitter website, via short message service (e.g. on a cell phone), instant messaging, or third-party applications. The updates are displayed on the user's profile page and instantly delivered to other users who have signed up to receive them. Users can receive updates via the Twitter website, instant messaging, SMS, email or through an application. For SMS, four gateway numbers are currently available: short codes for the USA, Canada, and India, as well as UK number for international use. The company has been busy adding features to the product like Gmail import and search. They recently launched a new site section called “Explore” for external and third party tools that interact with Twitter and a new visualization tool called Twitter Blocks. The service was started by Obvious Corp, who also started Odeo. Twitter allows users to send messages in two ways: 1) Direct Messages These messages are sent from a user logged into twitter to another user individually. These are not visible to any other users. This is done by entering: d username message and users get their ping if they have direct messages enabled on their phone or IM account. 2) Public Messages These messages are sent to everyone (who are following a particular user) and displayed on web pages accessible by all twitter users. We have implemented an extension to this concept in order to involve group messaging through mobile phones. Twitter is a service for friends, family, and co–workers to communicate and stay connected through the exchange of quick, frequent answers to one simple question: What are you doing? We have changed this to answer the question: Where are you? Twitter is written in Ruby on Rails. Twitter exposes some of its functionality via an Application Programming Interface (API). It aims to serve as a reference for developers building tools that talk to Twitter. It itself allows the integration of Twitter with other web services and applications. There are many API wrappers available for developing applications in other languages. We have used the Java and C# wrappers that are available freely. Related Work _____________________________________________________________________________ Twitter has been very successful since it was introduced in March 2006. Due to its success, there have emerged a number of sites that imitate its concept but add country-specific services or combining the micro-blogging facilities with other services, such as filesharing. In May 2007, one source counted as many as 111 such "Twitter look-alikes" internationally. In 2008 microblogs are becoming increasingly a topic on their own with articles in major newspapers such as 4|Page El País. Here, we list some of the prominent related services: Pownce It is a free social networking and micro-blogging site started by Internet entrepreneurs Kevin Rose, Leah Culver, Daniel Burka, and Shawn Allen. Pownce is centered around sharing messages, files, events, and links with already-established friends. The site launched on June 27, 2007, and was opened to the public on January 22, 2008. It is more functional than Twitter but there are fewer users. Pownce has been compared favorably to other websites with similar functionality like Twitter, and has been called a "Twitter on steroids".It has also been recommended for use over Twitter in a work setting because of its enhanced discussion-tracking capabilities 2) Jaiku It enables people to “share their presence.” It is similar to Twitter in that its mini-blogs reach both computers and mobile phones. It provides another way to connect with the people you care about by sharing your activities with them on the Web, IM, and SMS - as well as through a slew of cool third-party applications built by other developers using our API. 3) Dodgeball It is a social networking software provider for mobile devices. It was acquired by Google in May 2005. Users send their location to the service, which then notifies them of crushes, friends, friends' friends and interesting venues nearby. In April 2007, the founders of Dodgeball quit Google to work on other projects. 4) CenceMe This is a personal sensing system that enables members of social networks to share their sensing presence with their buddies in a secure manner. Sensing presence captures a user’s status in terms of his activity (e.g., sitting, walking, meeting friends), disposition (e.g.,happy, sad, doing OK), habits (e.g., at the gym, coffee shop today, at work) and surroundings (e.g., noisy, hot, bright, high ozone). CenceMe injects sensing presence into popular social networking applications such as Facebook, MySpace, and IM (Skype, Pidgin) allowing for new levels of “connection” and implicit communication (albeit non-verbal) between friends in social networks. All of these communications could be done as easily by e-mail but Twitter is appealing because it is new, brief and fits easily into computers and mobile phones. Objectives ______________________________________________________________________________ The main objectives of our project are to include the following features in out project: 1) Presence-based: Presence, simplified, is the information about a user's current availability status. By indicating who is online and who is away or who is busy and who is free, presence provides information that can be used to help determine who can answer a question or complete a task immediately. Presence based information is made available by including the availability information and the 5|Page location from which a message was sent in the text message sent by the user sending. The presence information combined with location information is even more informative as the users not only get to know whether another user is available for communication but also where the user is available, and the mode of communication can be accordingly decided. For example, if the user is nearby, face-to-face communication can take place, if the user is far but in an informal environment, a phone can be used for communication and if the user is far but in a formal environment instant messenger can be preferred over a phone. 2) Location-based : We have extended Twitter in our application to add the location of users to Twitter messages to find friends of the user within a particular area. The privacy of the user is taken into account by giving a choice to the user, whether he wants to disclose his location or not. The location is also used to build a page for every location which has messages written by users about the particular area. Again, only those messages will be visible to a user which were either public messages or were sent to a group to which the user belongs. This is implemented by adding GPS co-ordinates to text messages to track the location from which message was sent. Social Networking:_____________________________________________________________ We have added the concepts of groups which is currently not present in twitter. The user can create groups and send updates to only a particular set of friends as opposed to all friends. The concepts of groups allows users to utilize different privacy level (any number of privacy levels) as groups can be used to inherently represent a privacy level. 6|Page Architecture Diagram ______________________________________________________________________________ The main interactions between different components are as follows: CLIENT APPLICATION 1. SMS 4. Messages, locations TWITTER SERVER 2. Twitter API request 7|Page 3. Browser : login.jsp Flow Chart ______________________________________________________________________________ The main flow of data and information in our system USER CLIENT APPLICATIO N SERVER CLIENT APPLICATION 8|Page Selects a group Inputs message to be sent Embed user location using GPS and user choices Integrate this and group id with message Send message to Server using SMS Retrieves members in the group selected by the user from database Retrieves their latest notified status message+ GPS location Finds members within a particular distance radius Sends them this message Show GPS location of each Twitter friend in the vicinity specified Have a page showing the Twitter messages of these friends When they were in the vicinity specified 2) Flow of information related to location-based User A wants to send a message to all friends in a range r 9|Page Compute distances from GPS info in the database Show on map each location of the retrieved user co-ordinate Show a page containing Twitter messages for all the returned users Technologies Used _____________________________________________________________________ 1) Device Motorola Symbol MC 35 The robust mobile data capabilities in this pocket able device include email, instant and text messaging, image capture and bar code scanning. GPS-enabled Embedded GPS with Express GPS connect It has Windows based OS We used this Motorola mobile phone provided. We could use the built-in GPS for the location-based functionality of the project. The mobile phone had a Windows based OS due to which we decided to work on Microsoft Technologies and C#. 2) Server Side The server side uses Apache Tomcat 6.0 web server and MySQL 5.0 database. JSP is used for server side dynamic processing of html pages. The Map API we have used is Google Maps. Dynamic map APIs aren’t rendered properly on the mobile screen, hence we had to use static map APIs. We have hosted our application on a free domain, the link for our application is http://twittermaps.s41.eatj.com/TwitterReturns/login.jsp 3) Client Side a) Emulator: Pocket PC 2003 We used this emulator to test the application before deploying it to the actual device b) Development Framework: .NET Framework 2.0 IDE: c) Microsoft Visual Studio 2005 d) Microsoft Active Sync ActiveSync is a synchronization program developed by Microsoft which allows a mobile device to be synchronized with either a desktop PC, or a server running Microsoft Exchange Server. Only Personal information manager (PIM) data (Email/Calendar/Contacts) may be synchronized with the Exchange Server. e) Twitter API – C# wrapper Since, the client application mainly used C# language; we used the readily available ‘yedatwitter’ C# wrapper Implementation Details 10 | P a g e _____________________________________________________________________ Listed and explained below are the different functional components of our project: 1) Client Side Application User has a form-like interface to start the application. He/she has to input the following information: a. Group name from her/his list to send Twitter Text Message to or simply make a choice to send it to everyone. This name of the group is appropriately mapped to a group id to reduce the number of characters to be sent for the group information and increase the number of characters allotted for the message. b. Along with this, the user has an option whether to disclose and send his/her location thus introducing some privacy. c. Also, the user could select if he/she wishes to send the message to all the group members or only the ones in his area. This would include some additional processing on the server side. d. The user can select a status from the following options: i. Available ii. Busy iii. At Work iv. Ping if Urgent v. Having Fun vi. Sleeping Thus, it conveys more details rather than just suggesting if the user is available or busy. This inculcates some presence based information and tells the group members if the user is keen to be contacted or prefers not to be disturbed. e. Finally, the user inputs the message to be sent. Twitter allows a message length of 140 characters. Because of the other information to be sent along with the message, the length gets further reduced to 117 characters. This is a drawback of the system. The other option that could be used would be to send 2 messages; one containing the actual message and the second one sending the rest of the information. However, this would increase the cost incurred since the user will be charged for 2 messages rather than one. Hence, we preferred the earlier option. If the user selects to display his/her information, the GPS information i.e., latitude and longitude is extracted and included in the message. Hence, the message finally is composed as: Message = 11 | P a g e Group Id (2 chars) + Location Information (if user wants to send his/her information) (1 char) + Send to everyone or just people in user's area (1 char) + Latitude (6 chars) + Longitude (7 chars) + Status (1 char) + Message ( 117 chars) This message is sent to the virtual twitter user that we have created as a direct message. 1) Server Side Device The server side has been built using an open source wrapper around the twitter API. JTwitter is a wrapper around the twitter API which gives the capability of sending and retrieving user’s messages (direct messages as well as public messages). The server also has a database which stores the information about the groups, location and availability of users. There are three main tables in the database – a) AvailabilityInfo - A table containing the availability information. This table has two columns corresponding to the name of the user and the availability of the user. b) MessageLocationInfo - A table containing the location information. The GPS location of a user has two components – latitude and longitude. The table contains five different columns – the name of the user, the latitude of the user location, the longitude of the location, the message that was sent from that location and the group to which the message was sent. c) GroupInfo - A table containing group information. This table has three columns – a column with the name of the user who created a group, a column containing the group id and a column containing the name of a member of the group. Thus each group has as many entries in this table as the number of group members. d) LocationInfo – This table contains two columns with the name of the user and the most recent known location of the user. As opposed to MessageLocationInfo this table does not contain all locations from which a user has sent messages but only contains that location where the user was most recently known to be present. The server also acts as a virtual twitter user and has its own login/password for the twitter website. The group specific message requests or location specific message requests are sent to the server as direct messages to the user corresponding to the server on the twitter website. The server logs into its account on twitter and retrieves all direct messages sent to it and processes them subsequently. The server parses the message to extract the group to which the message needs to be sent, the location(latitude and longitude) of the user, whether the user wants to send the messages only to people around his location or all his friends and his availability information. This information is then inserted into the appropriate tables – If the user chose to reveal his location – then the location information, along with the message sent at the location and the group to which the user sent the message are inserted into ‘MessageLocationInfo’. The location is also used to replace any earlier known location of the user in the 'LocationInfo' table with their current location. 12 | P a g e a) If availability information was sent it is added into the availability information table ‘AvailabilityInfo’. Then the names of the users to which a message is to be sent are retrieved b) If the message being sent was group specific, the names of the users belonging to that group are retrieved from the database. c) If the message being sent was location specific, the locations of the friends of the user are retrieved from the database and the distance between the user and each of his friends is calculated. Those friends are selected who are within a pre-defined radius around the user. d) If the message is both group specific and location specific, the names of friends in that group are retrieved, their locations are retrieved and the distance between that user and the friends belonging to that group are calculated. Those group members are selected who are within a pre-defined radius around the user. e) The message is sent to the set users so retrieved 3) Maps The location based information that is stored with each message can be displayed informatively using maps. This will extend the scope of social networking from cyber-space to real-life. Coupled with the presence-based information that we provide in our application, we provide a broader range of possibilities with social-networking. For effective information visualization, we use Google Maps. Our application allows the users to see the GPS location of our Twitter friends who are currently in the vicinity of our current location. This information can be useful for setting up impromptu meetings, chats and conferences. The availability information is additional information that can facilitate such interactions. Moreover, as we move and as our friends move, we can keep seeing who all are in our vicinity. This dynamic information can be very useful indeed. Also, our application protects the privacy of the application users allowing them with the option of not letting the application know their current GPS location. This will prevent issues of location tracking and privacy infringements. In such cases, the database will contain the last GPS location that the user chose to reveal. The fact that the application is mobile based was a limiting factor in displaying loads of information using maps. We had to take special care not to clutter the maps with the information, at the same time provide useful data in a visually simple manner. We have used the Google Maps static API. Screen Shots 13 | P a g e I) CLIENT APPLICATION: This is a screenshot of the application on the Pocket PC 2003 Emulator: 14 | P a g e This is the login page if the user wants to check the messages or locations of the users: 15 | P a g e This is the screenshot of the Locations page which lists all the locations of the users: 16 | P a g e This is the screenshot of the map displayed when clicked on a particular friend's location: This is the screenshot of the Messages page which lists all the messages of the users at that 17 | P a g e location: 18 | P a g e Conclusion To conclude, we can state that we have developed a useful and effective extension to Twitter to improve its usability and application. Three most interesting contributions of our project design and/or implementation: a) We have creatively utilitied the synergy of microblogging, location-based information, presencebased information and online communities. Our work presents the glimpse into the realm of possibilities that the future holds for social networking. b) Our application offers a new level of freedom to Twitter users, by allowing them to communicate more fruitfully using their cell phones. It also extends the reach of normal text messaging by incorporating group, location-based and presence based capabilities. c) Our application has two parts – one involving the message sending capabilities and the other involving message browsing capabilities. The message sending can be done either through the web, mobile or im. However, to enable ease of use of location based information, we would recommend a GPS enabled phone for sending message. We recieve the message as a direct message, once again, the three ways mentioned above that Twitter provides are compatible with our application. To see the additional information that our application provides, we require internet connectivity. We have hosted this information on a free domain over the web. This can be viewed in our phone browsers when we are on the move or in our computer browser when we are not. d) We have even considered privacy issues related to Location based information and Presence based information. When a user doesnt want to provide his location co-ordinates he can choose to not disclose it. Also his presence information is an indicator of the kind of privacy he expects at the moment. With groups he can ensure that the messages arent sent to unwanted recipients. e) There have been very less applications which use the Java wrapper of Twitter. In order to use .NET Framework and to run our application on Windows based OS, we have worked on Java and used the Twitter API Java wrapper. f) In order to maintain integrity of data and avoid duplication and replication, we have normalized our database as much as possible. This ensures less space wastage on the server and more efficiency. What we learned through the hand-on experience of doing this project? This was our first project using Mobile Devices. Hence, it was a new arena altogether. We learnt new things like sending SMS through an application or obtaining the GPS location on a mobile device. Secondly, we have worked mainly in Java and this was the first time that we used .NET Framework. We also built our first web-based application using JSP. We have a lot of compatibility issues as regards the different technologies and environments we used and it was quite a learning experience to integrate different technologies, APIs, languages and environments. What concepts and techniques that we learned in class are used in the current project design: 19 | P a g e 1) Social Network and Web 2.0: We have built on the existing social networking service Twitter enhancing its functionality further by inculcating groups within in. 2) Location Based Services: We have implemented a Location finder to find the friends within a particular area of the Twitter user: 3) To prevent Location Privacy Threats, we have given the user a choice whether one wants to disclose and send one's location in the message or not. What concepts and techniques you learned in class can be considered for extension of your current project. 1) Search Engine: We could integrate a search engine with the project in order to search messages related to a particular topic or containing a specific keyword. This would prove useful for fast information retrieval. 2) Location-based advertisement/entertainment: Ad-sense can be incorporated using location information using his/her latest location data available. 3) Range query: Using range queries that we have already used to find friends in the same area, companies and shops can send E-coupons to all customers within a particular area around the store 4) We can have intelligent planner applications built on top of our application. Based on historical data of our location, presence and communication content with specific groups, an intelligent agent can come up with schedules and suggestions. Also we can feed our expected schedule into such an application and it can suggest Twitter friends we can meet. 5) A new way of recommendation can be developed based on the location + presence + microblogging + groupinfo that our application provides. This technique would increase the effectiveness of the traditional methods for recommending. Recommendations of new friends, recommendations to form/join new groups, recommendations to visit places of interest in our vicinity, the possibilities are endless. 20 | P a g e Future Work The main achievements of our project have been the introduction and integration of groups, location-based information and presence-based information with Twitter functionality. Moreover we have made our application mobile-based to facilitate users to interact even when they are on the move. Our present work opens up interesting possibilities, some of which are as follows 1. Our application can be used as an effective tool by e-advertisers. Not only do we provide location info, we also provide presence information. The Twitter message in itself is a reflection of the user’s current state of mind, since unlike other social networking sites, Twitter consists of micro blogs about oneself. This presents a natural opportunity for incorporating ad sense more effectively. 2. We can have intelligent planner applications built on top of our application. Based on historical data of our location, presence and communication content with specific groups, an intelligent agent can come up with schedules and suggestions. Also we can feed our expected schedule into such an application and it can suggest Twitter friends we can meet. 3. A new way of recommendation can be developed based on the location + presence + microblogging + groupinfo that our application provides. This technique would increase the effectiveness of the traditional methods for recommending. Recommendations of new friends, recommendations to form/join new groups, recommendations to visit places of interest in our vicinity, the possibilities are endless. 21 | P a g e 22 | P a g e References 1. Motodev http://developer.motorola.com/docstools/sdks/motorola64/ 2. Google Maps http://www.codeproject.com/KB/scrapbook/googlemap.aspx?fid=323057&df=90&mpp=25&noi se=3&sort=Position&view=Quick&fr=76 3. Mapping with a GPS and C# http://www.codeproject.com/KB/cs/GpsMapping.aspx 4. Open-source Java Interface to Twitter http://thinktankmaths.com/java-twitter/ 5. Sending SMS through client application http://msdn2.microsoft.com/en-us/library/aa446545.aspx 6. Using ActiveSync 4.5 with Visual Studio 2005 and the Emulator http://www.pocketpcfaq.com/faqs/activesync/activesync4x-visualstudio-emulator.htm 7. The Java Developers Almanac 1.4 for Java-MySQL connection http://www.exampledepot.com/egs/java.sql/pkg.html 23 | P a g e