EventFeedTile Documentation
Overview
The EventFeedTile is a component designed to display a dynamic list of global events based on user-defined search queries and time spans. It is integrated with the GDELT event API, allowing users to filter events by keywords over specified periods. The tile supports features like searching, loading states, error handling, and dynamically generated results.
Purpose
The primary purpose of the EventFeedTile is to provide users with an intuitive interface to search and filter global events. Users can input keywords to fetch relevant events and view a brief summary of each event, including title, source domain, occurrence date, and a sentiment score.
Settings
The configurable settings for the EventFeedTile are specified in the tile.config object. Below is a detailed explanation of the available settings.
Settings Breakdown
-
defaultQuery
- Input Type: String
- Description: This setting represents the initial search query that populates the search input field when the tile is rendered. Changing this value modifies the default query displayed to the user.
- Default Value: An empty string
"".
-
defaultTimespan
- Input Type: String (Dropdown option)
- Description: This setting defines the default timespan for the events to be fetched, from the following options:
15min(15 minutes)1h(1 hour)1d(24 hours)7d(7 days)1m(30 days)
- Changing this setting affects the predefined filter applied to the search results. For example, setting this to
7dwill only return events from the past week. - Default Value:
"1d".
How It Works
- The
EventFeedTilemanages its state, including the search query, selected timespan, articles fetched, and error states. - Upon entering a search query and selecting a timespan, the user can trigger a search by pressing the enter key or clicking a button.
- The search function constructs a request to the GDELT API with the specified parameters and handles responses to populate the displayed articles.
- The component also includes error handling to alert the user in case of a failed fetch operation.
- The search results are rendered as a list of clickable items that direct the user to the source event.
Data Expectations
The EventFeedTile expects the following data structure from the API response:
{
"data": [
{
"url": "https://example.com/event",
"title": "Sample Event Title",
"seendate": "2023-10-10T00:00:00Z",
"tone": -0.5
},
...
]
}- Properties:
url: A string containing the URL to the original event.title: A string for the title of the event.seendate: A string in ISO format representing when the event occurred.tone: A numeric value representing the sentiment of the event (positive or negative).
AI Integrations
Currently, there are no specific AI integrations directly within the EventFeedTile. However, the sentiment analysis represented by the tone field could potentially be enhanced using AI-based sentiment analysis services to provide richer insights on event data in future iterations.
Billing Impacts
Utilizing the EventFeedTile may have billing implications based on API call limits and the number of requests made to the GDELT service. Furthermore, frequent updates and searches may incur additional costs if the API’s pricing model is based on usage metrics.
Use Cases & Examples
Use Cases
-
News Aggregation Platform
- A news aggregation platform can use the
EventFeedTileto allow users to search for global occurrences by events, providing real-time updates directly from different news sources.
- A news aggregation platform can use the
-
Research and Academic Studies
- Researchers studying global trends and events can use this component to filter events based on specific keywords and time spans, aiding in the collection of data for their analyses.
-
Crisis Management
- Emergency services can implement the
EventFeedTileto monitor real-time data about global events, allowing them to react faster to crises by searching for specific emergencies, such as natural disasters.
- Emergency services can implement the
Example Configuration
Scenario: A news platform wants to configure the EventFeedTile to show latest sports events related to football, allowing searches for recent activities from the last month.
Configuration Data:
{
"config": {
"defaultQuery": "football",
"defaultTimespan": "1m"
}
}Usage:
- Set the
defaultQueryto "football" to pre-fill the search box, which encourages users to explore events related to football. - Set the
defaultTimespanto "1m" to restrict the search results to the last 30 days, ensuring they only see recent activities related to their interests.