Now Playing Network Replies Feature
Repository
https://github.com/alex-osman/nowplaying/
Pull Request
https://github.com/alex-osman/nowplaying/pull/68
New Features
Same song replies
The nowplaying bot now recognizes when a track has been seen before and includes the post in the reply.
As our library grows we will have more and more people posting about the same song and it's a great way to meet new people with similar music tastes.
Implementation
The reply function now calls a new function addTrackReply(post: Post, track: Track, playlist: Playlist) to generate a reply.
const posts = await this._database.getPostsByTrack(track)
const text = posts.map(post => `@${post.author} posted this song on [${dateformat(post.created, 'mmmm dS')}](${post.getLink()})!`)
The posts variable is an array of posts that contain the same song. A string with a link to that post is created for each one.
The new database function getPostsByTrack selects all posts where track_id is the same
SELECT * FROM tracks INNER JOIN posts on postId=posts.id where spotify_id=?
Now Playing
Check out the #nowplaying community and bot in action here
Commits
https://github.com/alex-osman/nowplaying/commit/239f441831dac26d2205f0079e60bdfd83ee97b1
https://github.com/alex-osman/nowplaying/commit/72a17f2ba68c83cf732f81cd0296c38f0eb93cd2
https://github.com/alex-osman/nowplaying/commit/2bbe32287bf758a05da6631ea69907a4fd9b02d8
Leave Now Playing Network Replies Feature to:
Read more #utopian-io posts
Best Posts From Walnut
We have not curated any of walnut1's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From Walnut
- Now Playing Week 63: Hiatus - We Can Be Ghosts Now
- Now Playing Week 62: Swearin' - Here to Hear
- Now Playing Week 61 - Simple by Jay Som
- Now Playing Week 60 - Whitney & Wilco
- Now Playing Week 59: Hazel English
- u
- Now Playing Week 56 - Uncomfortably Numb: American Football (feat. Hayley Williams)
- Now Playing: Week 55 - You Don't Want To Get You One Of Those
- Now Playing Week 41
- Now Playing - Week 40 - Kero Kero Bonito
- Now Playing Week 37 - Destroyer
- SMART MEDIA FUTURES: The RECORD SMT - Sndbox Weekly Question
- Now Playing Week 34 - Kurt Vile
- Now Playing Week 32 - North by Phoenix
- How do you feel when you listen to a song you like?
- Now Playing Week 31 - Jay Som
- Now Playing Network Replies Feature
- Now Playing Week 29
- ~nowplaying test~
- Now Playing Week 28