Add MediaStack and NewsData.io connectors for custom news sources#133
Add MediaStack and NewsData.io connectors for custom news sources#133Coooder-Crypto wants to merge 1 commit intoPolymarket:mainfrom
Conversation
| class MediaStackNews: | ||
| def __init__(self) -> None: | ||
| self.api_key = os.getenv("MEDIASTACK_API_KEY") | ||
| self.base_url = "http://api.mediastack.com/v1/news" |
There was a problem hiding this comment.
API key transmitted over unencrypted HTTP connection
The MediaStack connector uses http:// instead of https:// for the API endpoint. This causes the access_key API credential to be transmitted in plaintext over the network, where it can be intercepted by attackers. MediaStack supports HTTPS on all plans (including free), and the other connectors in the codebase (news.py and newsdata.py) all use HTTPS. The base_url needs to use https://api.mediastack.com/v1/news.
| if date_start and date_end: | ||
| params["date"] = f"{date_start:%Y-%m-%d},{date_end:%Y-%m-%d}" | ||
| elif date_start: | ||
| params["date"] = f"{date_start:%Y-%m-%d}" |
There was a problem hiding this comment.
Date end parameter silently ignored without date start
The date_end parameter is silently ignored when date_start is not provided. The conditional logic only checks for date_start and date_end or date_start alone, with no branch handling date_end by itself. This contrasts with the NewsData.io connector, which correctly handles both date parameters independently. Callers expecting date filtering with only an end date will receive unfiltered results without any warning.
Summary
Issue
Note
Introduces additional news sources with consistent
Articlenormalization and CLI access.MediaStackNewsandNewsDataNewsconnectors to fetch articles, support optional date filters, and map provider responses toArticlefieldsget_mediastack_newsandget_newsdata_newsto query these sources.env.examplewithMEDIASTACK_API_KEYandNEWSDATA_API_KEYWritten by Cursor Bugbot for commit 5914617. This will update automatically on new commits. Configure here.