Back to APIs list

Hacker News API examples & templates

Use these vals as a playground to view and fork Hacker News API examples and templates on Val Town. Run any example below or find templates that can be used as a pre-built solution.
cocodrilette avatar
hnResume
@cocodrilette
interval
Send the top 5 HackerNews post to your email every day at a given Datetime.
pomdtr avatar
greenSnipe
@pomdtr
http
Code Search is Easy Earlier this week, Tom MacWright posted Code Search is Hard . He describes the research he his doing to improve the code search experience of Val Town . It was a great read, and you might have seen it trending on Hacker News . As Val Town's most active user (behind Steve Krouse, one of the founders of Val Town), I for sure agree with Tom that search feature of Val Town needs improvements. But while reading his post, I immediately thought of a different approach to the problem. And a few hours later, Val Town Search was born. Do things that don't scale How does this new shiny search engine work? Well, it's quite simple. I wrote a Deno script that fetches all vals from the Val Town API. I pushed the data to a Github Repository I added a Github Action that runs the script every hour to refresh the data. I created a simple frontend on top of the Github Search API that allows you to search the data. It's hosted on Val Town (obviously). That was it. I didn't have to build a complex search engine, I just used the tools that were available to me. Is this a scalable solution for Val Town? Probably not. Am I abusing the Github API? Maybe. Does it work better than the current search feature of Val Town? Absolutely! I hope that the val.town engineers will come up with a search feature that will put my little project to shame. But for now, you won't find a better way to search for vals than Val Town Search .
pomdtr avatar
code_search_is_easy
@pomdtr
http
Code Search is Easy Earlier this week, Tom MacWright posted Code Search is Hard . He describes the research he his doing to improve the code search experience of Val Town . It was a great read, and you might have seen it trending on Hacker News . As Val Town's most active user (behind Steve Krouse, one of the founders of Val Town), I for sure agree with Tom that search feature needs improvements. But while reading his post, I immediately thought of a different approach to the problem. And a few hours later, Val Town Search was born. Do things that don't scale How does this new shiny search engine work? Well, it's quite simple. I wrote a Deno script that fetches all vals from the Val Town API. I pushed the data to a Github Repository I added a Github Action that runs the script every hour to refresh the data. I created a simple frontend on top of the Github Search API that allows you to search the data. It's hosted on Val Town (obviously). That was it. I didn't have to build a complex search engine, I just used the tools that were available to me. Is this a scalable solution for Val Town? Probably not. Am I abusing the Github API? Maybe. Does it work better than the current search feature of Val Town? Absolutely! I hope that the val.town engineers will come up with a search feature that will put my little project to shame. But for now, you won't find a better way to search for vals than Val Town Search . PS: This post was written / is served from Val Town
stevekrouse avatar
code_search_is_easy
@stevekrouse
http
Code Search is Easy Earlier this week, Tom MacWright posted Code Search is Hard . He describes the research he his doing to improve the code search experience of Val Town . It was a great read, and you might have seen it trending on Hacker News . As Val Town's most active user (behind Steve Krouse, one of the founders of Val Town), I for sure agree with Tom that search feature of Val Town needs improvements. But while reading his post, I immediately thought of a different approach to the problem. And a few hours later, Val Town Search was born. Do things that don't scale How does this new shiny search engine work? Well, it's quite simple. I wrote a Deno script that fetches all vals from the Val Town API. I pushed the data to a Github Repository I added a Github Action that runs the script every hour to refresh the data. I created a simple frontend on top of the Github Search API that allows you to search the data. It's hosted on Val Town (obviously). That was it. I didn't have to build a complex search engine, I just used the tools that were available to me. Is this a scalable solution for Val Town? Probably not. Am I abusing the Github API? Maybe. Does it work better than the current search feature of Val Town? Absolutely! I hope that the val.town engineers will come up with a search feature that will put my little project to shame. But for now, you won't find a better way to search for vals than Val Town Search .
petermillspaugh avatar
january2024
@petermillspaugh
script
petemillspaugh.com clippings: #1 – January 2024 Process for sending out a newsletter: Publish newsletter on the Web Fork this val and update subject, webUrl, targetSendDate Uncomment call to insertIntoNewslettersTable Add to @petermillspaugh/newsletters list Val
pomdtr avatar
hackernews
@pomdtr
script
An interactive, runnable TypeScript val by pomdtr
elsif_maj avatar
topHNThreadByHour
@elsif_maj
email
// set at Thu Nov 30 2023 14:22:53 GMT+0000 (Coordinated Universal Time)
stevekrouse avatar
hnTopStory
@stevekrouse
http
// Get the title of the top story on Hacker News
iakovos avatar
hnTopTenStories
@iakovos
script
// Get the title of the top story on Hacker News
stevekrouse avatar
hnSearch
@stevekrouse
script
Search Hacker News via Agolia Look for the valid params: https://hn.algolia.com/api
iakovos avatar
renderTopStories
@iakovos
script
An interactive, runnable TypeScript val by iakovos
rodrigotello avatar
valTownInspoList
@rodrigotello
script
Val Town inspiration & use cases list List [as object] used in Val Town's use cases and inspiration. Check it out at in /examples/use-cases and /docs/tutorial/4
rodrigotello avatar
hnStoryToHTML
@rodrigotello
script
// Forked from @stevekrouse.hnStoryToText
1
Next