
"A while ago, the Gemini API added a feature to help work with URL content, URL Context. Previously you had to fetch and download the HTML of the page and pass it to the API. This feature allows Gemini to request content (with limits) from public web pages. I thought it would be interesting to test this against Reddit. In the past I've made use of Reddit's APIs,"
"but as they've pretty much destroyed access to those APIs, I thought this could be a good work around. Here's a simple demo I built. My demo parses the Astro subreddit, specifically the new feed, and asks for a summary of items that seem to require a developer's help, as well as items that may be critical of Astro. I began with my imports and loading in my key from the environment:"
Gemini API added a URL Context feature that lets the model request content from public web pages within limits. Previously clients had to fetch and pass page HTML manually. A demo targets the r/astrojs new feed to identify posts needing developer responses or critical of Astro. The demo initializes genai.Client with GEMINI_API_KEY and uses the gemini-flash-latest model. The prompt instructs scanning recent post titles and including thread URLs. The configuration enables a Tool with UrlContext, granting controlled web access similar to an internet pass for Gemini.
Read at Raymondcamden
Unable to calculate read time
Collection
[
|
...
]