I’m a retired Unix sysadmin. Over the years I’ve built things in COBOL, FORTAN, C, perl, rexx, PHP, visual basic, various Unix shells and maybe others. Nothing has been a real “application” - mostly just utilities to help me get things done.

Now that I’m retired, and it’s cold outside, I’m curious to try some more coding - and I have an idea.

The music communities here seem to post links to YouTube. I generally use Lemmy on my phone but don’t use YouTube, or listen to music, on my phone if I can help it. I’d like to scrape a music community here and add the songs posted to a playlist in my musicbrainz account.

Does that sound like a reasonable learner project? Any suggestions for language and libraries appreciated. My preferred IDE is vim on bash and I have a home server running Linux where this could run as a daemon, or be scheduled.

  • ericjmorey@programming.dev
    link
    fedilink
    arrow-up
    7
    ·
    edit-2
    10 months ago

    I’m going to assume you’re going to go ahead with the idea. You could make use of the fact that every lemmy based community has an RSS feed.

    • Great Blue Heron@lemmy.caOP
      link
      fedilink
      arrow-up
      4
      ·
      10 months ago

      Yes, I’m working on it now. Struggling with basic stuff like pulling values out of the json returned by the API when I ask for a list of posts. Python really does not click for me, but I’m determined, for now, to keep at it. An the RSS feed seems like a much easier (than what…?) way to just get new posts with each run - thank you!

  • Aurenkin@sh.itjust.works
    link
    fedilink
    arrow-up
    4
    ·
    10 months ago

    Sounds like you have some programming experience already but whether this is a reasonable learner project I think depends a bit in what kind of things you’re trying to learn but it sounds pretty good to me.

    If you’re going to be using a familiar language and you already know how to call web APIs pretty comfortably I think that’s a pretty reasonable pet project assuming musicbrainz has a public API (I’m not familiar with it unfortunately).

    If you’re wanting to learn some more basic stuff around calling APIs and maybe a language you’re not familiar with I would start by making something super dumb that calls an unauthenticated public API like a weather service or something.

    Ultimately I think your project idea sounds good though, just making a suggestion for something even simpler you could try as a stepping stone if you need to.

    Either way congrats on your retirement! Have fun with all the interesting projects you decide to pursue.

  • hallettj@beehaw.org
    link
    fedilink
    English
    arrow-up
    3
    ·
    10 months ago

    That sounds like a good learning project to me. I think there are two approaches you might take: web scraping, or an API client.

    My guess is that web scraping might be easier for getting started because scrapers are easy to set up, and you can find very good documentation. In that case I think Perl is a reasonable choice of language since you’re familiar with it, and I believe it has good scraping libraries. Personally I would go with Typescript since I’m familiar with it, it’s not hard (relatively speaking) to get started with, and I find static type checking helpful for guiding one to a correctly working program.

    OTOH if you opt to make a Lemmy API client I think the best language choices are Typescript or Rust because that’s what Lemmy is written in. So you can import the existing API client code. Much as I love Rust, it has a steeper learning curve so I would suggest going with Typescript. The main difficulty with this option is that you might not find much documentation on how to write a custom Lemmy client.

    Whatever you choose I find it very helpful to set up LSP integration in vim for whatever language you use, especially if you’re using a statically type-checked language. I’ll be a snob for just a second and say that now that programming support has generally moved to the portable LSP model the difference between vim+LSP and an IDE is that the IDE has a worse editor and a worse integrated terminal.

  • nickwitha_k (he/him)@lemmy.sdf.org
    link
    fedilink
    arrow-up
    1
    ·
    10 months ago

    If Python isn’t clicking with you and you want to try a newer language with a good standard library, maybe try Go. It is based on C but, is a bit easier to iterate in development. Plus, it was designed with network applications in mind so, it handles JSON pretty well. As an added bonus, it is compiled, making (from my perspective) running a daemon a bit more straightforward.

    As an aside, I am currently a software engineer and use (Neo)vim as my IDE, because of the comfort that I built up with the terminal and vim as a sysadmin. It works great as an IDE, especially with LSP and other QoL plugins.

    • Great Blue Heron@lemmy.caOP
      link
      fedilink
      arrow-up
      1
      ·
      10 months ago

      I’m a little determined to stick with Python because I feel that I should - everyone should be able to code Python :-)

      The main problem I have with it is the complex, relaxed, data structures. I’m finding that the type() command in interactive mode is helping a lot. I’m having lots of moments like - “Ah, I’m not down to the dict yet, I’m still in the list…”

      • nickwitha_k (he/him)@lemmy.sdf.org
        link
        fedilink
        arrow-up
        1
        ·
        10 months ago

        The way that I see it is that some languages will “click” while others may not. Nothing wrong with that. I like your determination!

        I’d say, from your stated problem, that you may be selling yourself short a bit. My colleagues and I frequently run into the same when debugging. And the approach that you are using to work through it is exactly what I’d recommend as well (along with type hinting). I also find the Python interactive shell great for testing concepts and do one-off things that are easier in Python than Bash.