ScenarioThis example demonstrates how FME Server can be used to:
- search for tweets with specific text, hash tags or users,
- provide the tweet with a spatial location by (a) utilizing the new Twitter Geotagging capability if provided or (b) geocoding the tweeter's profile location,
- write the spatially aware tweets out as KML and
- serve the KML using the KML Network Link Service for viewing in Google Maps and Google Earth.
How It WorksAs with most FME Server scenarios, a workspace is designed using FME Desktop (Workbench) and uploaded to FME Server - in this case three workspaces.
WorkspacesTweet Search and Archive (D008-tweet-archiver.fmw)
The first workspace searches for tweets that contain the text @safesoftware OR @fmedoctors OR @fmeevangelist OR @betabuilder. If a tweet isn't geotagged, an attempt is made to give the tweet a location by geocoding the tweeter's profile location. Ultimately, the tweets are output into a database for retrieval by another workspace that outputs KML. This intermediate or caching database is required to avoid exceeding the Twitter API rate limit of 150 requests per hour.
KML Output (D008-tweet-kml.fmw)
The second workspace reads the cached tweets, nostyles each tweet for KML and then writes them out to KML. This workspace is published to FME Server and registered with the KML Network Link Service.
Tweet Search and Archive Runner (D008-tweet-archive-runner.fmw) A third workspace uses the FMEServerJobSubmitter transformer to run the Tweet Search and Archive workspace on FME Server. The workspace is run at a set interval using a bat file. The interval is set to a value that won't exceed the Twitter API rate limit of 150 requests per hour.
Setting up the ExampleTo actually set up and run the example on your own system requires a certain set of software and setup.
- FME Server 2011+
- FME Desktop 2011+
- workspaces and required files
- Download the workspaces and required files zip file.
- Extract the zip file into C:\FMEDemos.
- Open the following readme file and follow the directions inside:
- C:\FMEDemos\D008 - Geo-Twitter\Documentation\readme.txt
Suggested Similar Articles
This example uses FME Server to receive real-time mobile asset locations, publish them to KML, determine if their an asset is inside of a geofence and if so a message is tweeted.
This details how to convert vector points to raster using rasterization and then how to display them intelligently in KML using Regions.
Read a COLLADA model file and place it at each location as defined in a set of input points then write the result to KML
This demo demonstrates how you can display and update data within Google Earth with FME Server's Data Streaming service and the KML Network Link Control.
Read and translate KML data, in this basic KML to MapInfo TAB translation.