[Blogging Intensifies]

Technology, Projects, Linux, Coding, Internet of Things, Music, Books, Life...

  • About
  • Code Projects
  • Photo Gallery

music

Code Project: Automated List From Reddit Comments

January 16, 2023
Python Logo

This is one of those quick and kind of dirty projects I’ve been meaning to do for a while. Basically, I wanted a script that would scrape all of the top level comments from a Reddit post and push them out to a list. Most commonly, to use on /r/AskReddit style threads like, well, for this example, “What is a song from the 90s that young people should listen to.”

Basically, threads that ask for useful opinions on list. Sometimes it’s lists of websites or something. Often it’s music. The script here is made for music but could be adjusted for any thread. Here is the script, I’ll touch on it a bit in more detail after.

## Create an APP for Secrets here:
## https://www.reddit.com/prefs/apps

import praw

## Thread to scrape goes here, replace the one below
url = "https://www.reddit.com/r/Music/comments/10c4ki0/name_one_90s_song_kids_born_after_2000_should_add/"

## Fill in API Information here
reddit = praw.Reddit(
    client_id="",
    client_secret= "",
    user_agent= "script by u/", # Your Username, not really required though
    redirect_uri= "http://localhost:8080",
)


submission = reddit.submission(url=url)
submission.comments.replace_more(limit=0)
submission.comment_limit = 1

for x in submission.comments:
    with open("output.txt", mode="a", encoding="UTF-8") as file:
        if "-" in x.body:
            file.write(str(x.body)+"\n")
            # print(x.body)

The script uses praw, Python Reddit API Wrapper. A Library made for use in Python and the Reddit API. It requires free keys which can be gotten here: https://www.reddit.com/prefs/apps. Just create an app, the Client ID is a jumble of letters under the name, the secret is labeled. User Agent can be whatever really, but it’s meant to be informative.

The thread URL also needs filled in.

The script then pulls the thread data and pulls the top level comments.

I’m interested in text file lists mostly, though for the sake of music based lists, if I used Spotify, I might combine it with the Spotify Playlist maker from my 100 Days of Python course. Like I said before though, this script is made for pulling music suggestions, with this but of code:

        if "-" in x.body:
            file.write(str(x.body)+"\n")
            # print(x.body)

It’s simple, but if the comment contains a dash, as in “Taylor Swift – Shake it Off” or “ACDC – Back in Black”, it writes it to the file. Otherwise it discards it. There is a chance it means discarding some submissions, but this isn’t precision work so I’m OK with that to filter out the chaff. If I were looking for URLs or something, I might look for “http” in the comment. I could also eliminate the “if” statement and just have it write all the comments to a file.

Share this:

  • Click to share on Facebook (Opens in new window)
  • Click to share on Tumblr (Opens in new window)
  • Click to share on Reddit (Opens in new window)
  • Click to share on Pinterest (Opens in new window)

Like this:

Like Loading...
Posted in: Programming Projects Tagged: music, Programming, Projects, Python, Reddit

My Music Listening Habits for 2022

December 31, 2022

It’s that time again, when I ramble on about what I’ve been listening to this year.  I don’t use Spotify so I don’t have a “cool kids” wrap up to share.  Instead you get this!  A blog post!  And some little 5×5 charts made from my Last.fm.  I kind of prefer starting on Artists over Albums, so without further ado, the top 25 for 2022.  Which unsurprisingly, is relatively similar to my previous years.

In a surprise to literally no one, including myself, my top 3 are pretty much the same as they have been for a while.  Aurora, CHVRCHES, and Sigrid.  Actually, I am a little surprised Sigrid is so high, I didn’t listen tot he new album a ton, or much Sigrid that I remember actually.  Aurora and CHVRCHES, not so much, I listen to both a lot.  Heck, I saw Aurora live this year.

Beyond that is a bit of new-ish stuff.  I’m still been digging on Radiohead’s Kid A Mnesia re-release, and I picked up a copy of OK Computer to add to that mix.  The Weeknd’s Dawn FM has become a pretty regular listen as well.  It’s an album I didn’t expect to enjoy as much as I do.   Orla Gartland and Dodie slot in at numbers 6 and 7.  I almost went to see Dodie (and Orla) earlier this year but my wife had a Doctor’s thing come up and COVID was starting to ramp up again, so I opted to skip it.

Next on the list is Magdalena Bay, a newcomer to the list which a lot of the folks at the CHVRCHES discord recommended.  Another with this honor is Wolf Alice down in the number 17 slot.  I actually kind of prefer Wolf Alice to Mag Bay, but I picked up their album later, so they got less time to be listened to. Wolf Alice is a bit more, guitars and rock, while Mag Bay is more synth and electronic.  Also in this list of “Recommended by CHV People,” is Purity Ring at number 20.

Quite a few regulars on the list for a bit, though I want to comment on how much Raffaella has manages to stay in these lists.  I’m sure I mentioned it before, several times, but I had never hear of her back in 2019 before going to see Sigrid, and I’ve been listening to her music still, years later.  She hasn’t even really put out a lot of new stuff either, a couple of singles and a small sized EP.

I think Berlinist is new to the top 25, but this is entirely from listening to the Gris Video Game soundtrack.  It’s a good ‘relaxing music” album.  

There are a few missing that I’m actually surprised are missing.  Well, one anyway, which is Enya.  Not a new artist by any means, but I ended up with her entire discography, minus one, I think, at an estate sale, and I listened to quite a few of her albums recently.  It feels like it should have been enough to put her up there on the list.  It’s also really interesting because, Enya definitely reminds me of the same sort of, exotic, vocalizing, sort of style of Aurora.

Anyway, next up is the albums list, but a lot will have been covered by the Artists wrap up so I’ll just stick to anything interesting.

And it’s more or less an expansion of the Artists lists.  Most interesting, though not surprising is that every album from Aurora and CHVRCHES appears in this list.

I also noticed I forgot to mention the Cranberries.  Like Enya, I picked up a few Cranberries albums and I’ve been enjoying them.  It’s also funny because, Enya “feels” like an “Earlier Aurora” in a lot of ways, and The Cranberries, “feels” like an “Earlier CHVRCHES” in a lot of ways.  I could actually expand on this a bit with Sigrid too, because Alanis Morissette, “feels” like an “Earlier Sigrid.”

I guess my point is, the more things change,t he more they stay the same, and my overall musical tastes is about the same as it always has been, it’s just added the latest version of the same shtick.

Share this:

  • Click to share on Facebook (Opens in new window)
  • Click to share on Tumblr (Opens in new window)
  • Click to share on Reddit (Opens in new window)
  • Click to share on Pinterest (Opens in new window)

Like this:

Like Loading...
Posted in: Music Tagged: music, MyMusicHabits2022

Amazon Music Now Sucks Completely

November 6, 2022

Amazon Echo, probably the easiest and simplest way to listen to music I have, had just completely shat itself and it’s so incredibly frustrating.  I don’t understand why companies are so dead set on ruining every product they make (Oh wait, I do, something something endless growth bull shit, but that’s a rant for elsewhere).  I don’t care for Ala-carte subscription based music at all.  Artists general don’t get paid enough cut, and I like being able to listen to my music years to decades later, without paying monthly, endlessly.  I still own every CD I have ever bought.  Granted, I do buy some of my CDs used so the artist still gets nothing from that so I guess that’s mildly hypocritical.   Here’s an article about the change.

https://variety.com/2022/digital/news/amazon-music-prime-100-million-songs-shuffle-mode-podcasts-ad-free-1235416844/

My point is, I buy music digitally.  Hell, I bought a couple of albums just last Friday for #BandCampFriday.  I have literally hundreds of albums and thousands of trcks PURCHASED through Amazon Music.  I’ve been buying music through Amazon for over a decade.  More recently I shifted away a bit because I wanted to get FLAC options but when I can’t find FLAC I still buy from Amazon because the quality offered is still a pretty good MP3.  This made the Echo and Alexa super great because I could just tell it, “Alexa, play Aurora from my library”, and it would play my tracks, or whatever artist or album I wanted.

I even have an echo hooked to my sound system down in the basement so it sounds better.

But this recent change.  This isn’t even an option for music I have purchased.  Like now, as I type this, I played my album, “A Different Kind of Human”.  And it’s just randomly inserted some other random track in.  It’s also playing the tracks out of order.  I even tried playing it from the Alexa App on my phone.  Maybe it works better in the Amazon Music app but I had to dump that because it kept asking EVERY SINGLE TIME I opened it to subscript to Music Unlimited.

Which is the goal with this new Shuffle Play idiocy.  If you subscribe up, you can get all the old features back.  Which I have no interest in.  I own my music, and I already pay too much for Amazon Prime, which is going up AGAIN next year.  I don’t even have it on Auto Renew anymore because it’s like $150/year now and twice as much as when I started subscribing.  I really just want to pay $60/year or whatever for easier shipping.  I don’t care about all this extra nonsense.

I wouldn’t even mind this annoying change as much if it just worked with music I’ve purchased, but it doesn’t.

Looking for some answers or suggestions on fixing this around the web says that a lot of people are upset about this. Not just because of situations like mine where you can’t listen to your own music, but because of things like custom routines and playlists being completely broken as well. A couple that stood out to me were people who had routines set up for their kids to go to sleep listening to particular songs using playlists and timers. Another was how it completely breaks soundtracks to musicals, and I imagine it breaks other similar content with a need for linear tracks that run together like Stand Up Comedy and Dance mixes.

It all feels incredibly poorly thought out and frankly, it doesn’t drive me to upgrade my subscription (which is the point) but makes me want to find a different smart speaker solution that works better with my local network shares. If I were going to subscribe to music, it would be Spotify or Tidal over Amazon.

Share this:

  • Click to share on Facebook (Opens in new window)
  • Click to share on Tumblr (Opens in new window)
  • Click to share on Reddit (Opens in new window)
  • Click to share on Pinterest (Opens in new window)

Like this:

Like Loading...
Posted in: Music Tagged: Amazon, Amazon Music, Complaints, music
1 2 … 8 Next »

Categories

  • collapsCat options: Array ( [title] => Categories [showPostCount] => 1 [inExclude] => exclude [inExcludeCats] => Photos, Uncategorized, mastodon-feed, goodreads [showPosts] => 0 [showPages] => 0 [linkToCat] => 1 [olderThan] => 0 [excludeAll] => 0 [catSortOrder] => ASC [catSort] => catName [postSortOrder] => ASC [postSort] => postTitle [expand] => 0 [defaultExpand] => Technology, Maker, Coding, Hobbies [debug] => 1 [postTitleLength] => 0 [catfeed] => none [taxonomy] => category [post_type] => post [postDateAppend] => after [postDateFormat] => m/d [showPostDate] => 1 [useCookies] => 1 [postsBeforeCats] => 1 [expandCatPost] => 1 [showEmptyCat] => 1 [showTopLevel] => 1 [useAjax] => 0 [customExpand] => [customCollapse] => [style] => kubrick [accordion] => 1 [title_link] => [addMisc] => 1 [addMiscTitle] => [number] => 2 [includeCatArray] => Array ( ) [expandSym] => ► [collapseSym] => ▼ ) postsToExclude: Array ( ) CATEGORY QUERY RESULTS Array ( [0] => WP_Term Object ( [term_id] => 641 [name] => 100DaysOfCode [slug] => 100daysofcode [term_group] => 0 [term_taxonomy_id] => 641 [taxonomy] => category [description] => [parent] => 172 [count] => 14 [filter] => raw ) [1] => WP_Term Object ( [term_id] => 486 [name] => Advent of Code [slug] => advent-of-code [term_group] => 0 [term_taxonomy_id] => 486 [taxonomy] => category [description] => [parent] => 172 [count] => 27 [filter] => raw ) [2] => WP_Term Object ( [term_id] => 666 [name] => AI Art [slug] => ai-art [term_group] => 0 [term_taxonomy_id] => 666 [taxonomy] => category [description] => [parent] => 153 [count] => 5 [filter] => raw ) [3] => WP_Term Object ( [term_id] => 438 [name] => Books [slug] => books [term_group] => 0 [term_taxonomy_id] => 438 [taxonomy] => category [description] => [parent] => 436 [count] => 4 [filter] => raw ) [4] => WP_Term Object ( [term_id] => 172 [name] => Coding [slug] => programming [term_group] => 0 [term_taxonomy_id] => 172 [taxonomy] => category [description] => [parent] => 153 [count] => 11 [filter] => raw ) [5] => WP_Term Object ( [term_id] => 541 [name] => Concerts [slug] => concertphotos [term_group] => 0 [term_taxonomy_id] => 541 [taxonomy] => category [description] => [parent] => 527 [count] => 7 [filter] => raw ) [6] => WP_Term Object ( [term_id] => 155 [name] => Devices (Phones and Tablets) [slug] => devices [term_group] => 0 [term_taxonomy_id] => 155 [taxonomy] => category [description] => [parent] => 166 [count] => 9 [filter] => raw ) [7] => WP_Term Object ( [term_id] => 622 [name] => Elite Dangerous [slug] => elite-dangerous [term_group] => 0 [term_taxonomy_id] => 622 [taxonomy] => category [description] => [parent] => 523 [count] => 8 [filter] => raw ) [8] => WP_Term Object ( [term_id] => 606 [name] => Fairs [slug] => fairs [term_group] => 0 [term_taxonomy_id] => 606 [taxonomy] => category [description] => [parent] => 527 [count] => 8 [filter] => raw ) [9] => WP_Term Object ( [term_id] => 523 [name] => Feeds [slug] => feeds [term_group] => 0 [term_taxonomy_id] => 523 [taxonomy] => category [description] => [parent] => 0 [count] => 0 [filter] => raw ) [11] => WP_Term Object ( [term_id] => 436 [name] => Hobbies [slug] => hobbies [term_group] => 0 [term_taxonomy_id] => 436 [taxonomy] => category [description] => [parent] => 0 [count] => 0 [filter] => raw ) [12] => WP_Term Object ( [term_id] => 656 [name] => IOT Projects [slug] => iot [term_group] => 0 [term_taxonomy_id] => 656 [taxonomy] => category [description] => [parent] => 153 [count] => 19 [filter] => raw ) [13] => WP_Term Object ( [term_id] => 446 [name] => Language [slug] => language [term_group] => 0 [term_taxonomy_id] => 446 [taxonomy] => category [description] => [parent] => 436 [count] => 1 [filter] => raw ) [14] => WP_Term Object ( [term_id] => 524 [name] => Letterboxed [slug] => letterboxed [term_group] => 0 [term_taxonomy_id] => 524 [taxonomy] => category [description] => [parent] => 523 [count] => 276 [filter] => raw ) [15] => WP_Term Object ( [term_id] => 653 [name] => Link List [slug] => link-list [term_group] => 0 [term_taxonomy_id] => 653 [taxonomy] => category [description] => [parent] => 523 [count] => 29 [filter] => raw ) [16] => WP_Term Object ( [term_id] => 224 [name] => Linux & Open Source [slug] => linux [term_group] => 0 [term_taxonomy_id] => 224 [taxonomy] => category [description] => [parent] => 166 [count] => 6 [filter] => raw ) [17] => WP_Term Object ( [term_id] => 153 [name] => Maker [slug] => maker [term_group] => 0 [term_taxonomy_id] => 153 [taxonomy] => category [description] => [parent] => 0 [count] => 2 [filter] => raw ) [19] => WP_Term Object ( [term_id] => 530 [name] => Micro Blog [slug] => microblog [term_group] => 0 [term_taxonomy_id] => 530 [taxonomy] => category [description] => [parent] => 0 [count] => 55 [filter] => raw ) [20] => WP_Term Object ( [term_id] => 437 [name] => Music [slug] => music [term_group] => 0 [term_taxonomy_id] => 437 [taxonomy] => category [description] => [parent] => 436 [count] => 17 [filter] => raw ) [21] => WP_Term Object ( [term_id] => 395 [name] => My DIY Projects [slug] => my-diy-projects [term_group] => 0 [term_taxonomy_id] => 395 [taxonomy] => category [description] => [parent] => 153 [count] => 7 [filter] => raw ) [22] => WP_Term Object ( [term_id] => 154 [name] => Opinion/Editorial/Life [slug] => articles [term_group] => 0 [term_taxonomy_id] => 154 [taxonomy] => category [description] => [parent] => 0 [count] => 18 [filter] => raw ) [23] => WP_Term Object ( [term_id] => 491 [name] => Organizing [slug] => organizing [term_group] => 0 [term_taxonomy_id] => 491 [taxonomy] => category [description] => [parent] => 436 [count] => 7 [filter] => raw ) [24] => WP_Term Object ( [term_id] => 534 [name] => Other Photos [slug] => otherphotos [term_group] => 0 [term_taxonomy_id] => 534 [taxonomy] => category [description] => [parent] => 527 [count] => 12 [filter] => raw ) [25] => WP_Term Object ( [term_id] => 617 [name] => Outdoor and Nature [slug] => outdoor [term_group] => 0 [term_taxonomy_id] => 617 [taxonomy] => category [description] => [parent] => 527 [count] => 4 [filter] => raw ) [26] => WP_Term Object ( [term_id] => 242 [name] => PC Hardware [slug] => pcs [term_group] => 0 [term_taxonomy_id] => 242 [taxonomy] => category [description] => [parent] => 166 [count] => 6 [filter] => raw ) [28] => WP_Term Object ( [term_id] => 712 [name] => Programming Projects [slug] => projects [term_group] => 0 [term_taxonomy_id] => 712 [taxonomy] => category [description] => [parent] => 172 [count] => 7 [filter] => raw ) [29] => WP_Term Object ( [term_id] => 241 [name] => Synology NAS [slug] => synology-nas [term_group] => 0 [term_taxonomy_id] => 241 [taxonomy] => category [description] => [parent] => 166 [count] => 5 [filter] => raw ) [30] => WP_Term Object ( [term_id] => 166 [name] => Technology [slug] => technology [term_group] => 0 [term_taxonomy_id] => 166 [taxonomy] => category [description] => [parent] => 0 [count] => 9 [filter] => raw ) [31] => WP_Term Object ( [term_id] => 424 [name] => The Basement [slug] => the-basement [term_group] => 0 [term_taxonomy_id] => 424 [taxonomy] => category [description] => [parent] => 153 [count] => 6 [filter] => raw ) [32] => WP_Term Object ( [term_id] => 557 [name] => Toy Photos [slug] => toyphotos [term_group] => 0 [term_taxonomy_id] => 557 [taxonomy] => category [description] => [parent] => 527 [count] => 0 [filter] => raw ) [33] => WP_Term Object ( [term_id] => 1 [name] => Uncategorized [slug] => uncategorized [term_group] => 0 [term_taxonomy_id] => 1 [taxonomy] => category [description] => [parent] => 0 [count] => 0 [filter] => raw ) [34] => WP_Term Object ( [term_id] => 280 [name] => Windows [slug] => windows [term_group] => 0 [term_taxonomy_id] => 280 [taxonomy] => category [description] => [parent] => 166 [count] => 2 [filter] => raw ) [35] => WP_Term Object ( [term_id] => 538 [name] => Zoos [slug] => zoophotos [term_group] => 0 [term_taxonomy_id] => 538 [taxonomy] => category [description] => [parent] => 527 [count] => 12 [filter] => raw ) ) POST QUERY: POST QUERY RESULTS
  • ►Feeds (313)
    • Elite Dangerous (8)
    • Letterboxed (276)
    • Link List (29)
  • ▼Hobbies (29)
    • Books (4)
    • Language (1)
    • Music (17)
    • Organizing (7)
  • ▼Maker (98)
    • AI Art (5)
    • ▼Coding (59)
      • 100DaysOfCode (14)
      • Advent of Code (27)
      • Programming Projects (7)
    • IOT Projects (19)
    • My DIY Projects (7)
    • The Basement (6)
  • ►Micro Blog (55)
  • ►Opinion/Editorial/Life (18)
  • ▼Technology (37)
    • Devices (Phones and Tablets) (9)
    • Linux & Open Source (6)
    • PC Hardware (6)
    • Synology NAS (5)
    • Windows (2)
  • ►Uncategorized (0)

MastodonLinkedIn

emailInstagramInstagram

GitHubLetterboxdDuolongo
GoodreadsLast.fmElite Dangerous INARA
Lameazoid Logo


Copyright © 2023 [Blogging Intensifies].

Me WordPress Theme by themehall.com

%d bloggers like this: