Site Map - skip to main content

Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes Monday through Friday.


hpr3656 :: Importance of Small toy projects

Toy projects are a great way to learn a new language, and a project I did just for fun.

<< First, < Previous, Latest >>

Hosted by norrist on Monday 2022-08-08 is flagged as Clean and is released under a CC-BY-SA license.
Tags: python, programming.
Listen in ogg, spx, or mp3 format. | Comments (1)

Importance of Small toy projects

Inspired by

My recommendation for learning a new language.

  1. Think about a small problem you want to solve with code.
  2. Start banging away at it.
  3. Redo over and over, its OK
  4. Same project but better
  5. Learn new tech and practice

An example of one of my small projects

  • Original intent of my podfaded project
    • Mostly Tech/Linux podcasts
    • Find every podcast I could
    • Track release cadence
    • Rate how podfaded the feed is
    • Use search API to find RSS feeds

First attempt plan

  • Scrape podcast networks
    • used beautiful soup - something I wanted to learn anyway
    • HTML
      • Jinja templating - something I wanted to learn anyway
      • Bootstrap - something I wanted to learn anyway
      • Different colors based on how podfaded

First attempt problems

  • individual script per network
  • 4-5 different scripts
  • took forever to run
  • Broke when networks changed their page layout

Redo

  • Test Driven Development and pytest
    • Red Green Refactor
    • Confidence to change code
  • Simplify - one scrapper script
  • Embed audio player for latest episode

How it works - Scraping pages for feeds

  • scrape_for_feeds.py
  • Provide a list of websites that have lists of podcasts
  • Search the page for any links
  • Check if the feed is valid by trying to parse it with feedparser
  • Add feed to database

Podcasts pages I scrape

How it works - Checking the feeds

  • feed_info.py
  • loop through feeds
  • use feedparser to find latest episode
    • title and enclosure (audio file)

HTML Output

Feedback Welcome

  • https://gitlab.com/norrist/podfaded2
  • Bugs
    • Sometimes the title is missing, so some of the CSS coloring doesn't work
    • Excluded podcasts still occasionally show up on the list
  • Looking for more curated lists of podcast pages
    • not search sites
  • Maybe scrape HPR podcast recommendation episodes

Example
Example


Comments

Subscribe to the comments RSS feed.

Comment #1 posted on 2022-08-20T03:54:06Z by Some Guy On The Internet

Love this show.

I love this type of content. The ability to create from thin air whatever you want; even if it's not exactly "in demand". It always feels like I'm listening to a mage crafting new magical items just because the other one was out of reach.

<< First, < Previous, Latest >>

Leave Comment

Note to Verbose Commenters
If you can't fit everything you want to say in the comment below then you really should record a response show instead.

Note to Spammers
All comments are moderated. All links are checked by humans. We strip out all html. Feel free to record a show about yourself, or your industry, or any other topic we may find interesting. We also check shows for spam :).

Provide feedback
Your Name/Handle:
Title:
Comment:
Anti Spam Question: What does the P in HPR stand for ?
Are you a spammer →
Who hosted this show →
What does HPR mean to you ?