horizon.tech

Extracting and Plotting Newsworthy Events from Social Media

In this tutorial we'll show you how to use Horizon to extract newsworthy events from social media, plotting them on a map and publishing articles on them.

This tutorial is the basis for the plugin 'regional_news' powering websites such as worldpolitik.com. As with most advanced Horizon functions, you can build with the Workflow builder GUI or by building a custom plugin and setting spaces with webhooks (coming soon).

Step 1: Create a twitter or RSS collection under 'sources' for inputs.

In your 'sources' page, create RSS or X feeds. These feeds should then be combined into a collection.

The collection is your source for events. You can use Advanced X feed search to combine multiple accounts into a single X feed, or synthesize them separately into a collection.

Step 2: Create a space, set default snapshot, and create sources.

Your space will hold tables and will provide a visual for events extracted. You can also create a table titled 'events' and possibly various tables (tags) for distinct types and events. Since tables' visual display will depend on assigning symbol layers and colors, you can begin building the 'visual language' of your site.

Step 3: Create UI elements in the contents of the space

For displaying events it is necessary to build a running ticker of events along a sidebar, where each event type or actor has a different color. We want to build samples for each event type and include info in an 'event card' such as the symbol, a header, a timestamp, a brief description of events, and a source link.

Step 4: Create the plugin template.

Our plugin will consist of the following functionalities and must be hardcoded. First, we'll get most recent posts for our assigned collection. We will then pass a json format representing the 'events' schema that we built, and ask the AI to 'extract events from the list of posts, assigning each event to the format listed' and assigning it to one of several assigned 'event type' (table ids) and 'actor' (table ids).

(Later on, we will want to use Horizon to create GPTs that can be trained to improve this process).

Then, we want to retrieve the existing sidebar, wipe it of yesterday's events, and one by one pick the most recent events and rebuild the template. We do this by taking the existing placeholder blocks or creating new ones, setting each 'paragraph' component to show text, heading, and paragraphs.

You might also add a few other events like scrolling to a corresponding element upon clicking an event.

Step 5: Connect the plugin to your space and map to data

With your plugin created, you just need to attach the package to your workspace and then connect the plugin, mapping the predefined action IDs and event IDs to your appropriate tables.

Step 5: Assign all UI elements to a portal and pick a custom domain.

Once you've completed your event extraction handler, you can create a custom domain. From here you set your space to public and show off your map-based, daily event news ticker. If you want to add collaborators or expose an API, talk to Horizon about how you can automatically generate a powerful API for users to download with the events which you've captured.

horizon.tech

A low-code platform for data collection, schema management, data visualization, and publishing.

© 2024 - 2025 Yrbia LLC, Delaware. All rights reserved.