Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Financial Headline Generator as specified byhttps://www.smbc-comics.com/comic/markets

License

NotificationsYou must be signed in to change notification settings

OpenBagTwo/MarketWatch

Repository files navigation

Generate Post

A Meme Financial Headline Generator

What Is This?

I woke up one morning, and as am I am wont to do, was randomly wandering through theSMBC archivewhen I came acrossthis webcomic from 2020:

SMBC Markets

and I thought to myself, "Hey, I bet I could code that pretty easily!"

which is exactly what I did.

How does it work?

The two components going into generating the headlines were:

  • getting market data (is the market up or down on any given day?)
  • getting news headlines

I figured the first would be easy and the second would be hard, but the reverse ended up being true,as most Finance APIs I could find were either decommissioned (Google), paid (NASDAQ DataLink) ordidn't contain composite indices (Alpha Vantage). Luckily, not only isYahoo Financestill around, but there's even a well-maintained Python package calledyfinancethat I could use without even creating a developer account!

On the news side, I foundthis handy list of news media APIs and decided to go withThe Guardian. Their documentation was excellent and their API was extremely easyto use.

If you'd like to get a deeper look at how I combined the two halves, have a look at thethe development notebookor just jump straight intothe script that generates the posts. To runthe code, you'll need anenvironment with:

If you're interested in learning about the website side of things, take a read through theHugo quickstart guide. This project usestheBlonde theme, so have a look at their documentationas well.

If you're interested in the automation portion (new content is updated daily), it's all doneviaGitHub Actions

Contribution and Licensing

The project is licensed under theAffero GPL and all contributions, uses and modificationsmust be done under those terms (read: if you spin up your own site, you must make the source codepublicly available under the AGPL).


[8]ページ先頭

©2009-2025 Movatter.jp