Skip to content

Twitter bot to find what song is playing in a given uploaded twitter video.

License

Notifications You must be signed in to change notification settings

Xavier577/what-song-is-this

 
 

Repository files navigation

what-song-is-this

Twitter bot to find what song is playing in a given uploaded twitter video.

How to setup.

yarn install

How to run.

  • via npm script
yarn start
  • via node in terminal
node --experimental-wasm-threads src/app.js

This bot makes use of the wasm ffmpeg package for converting between multimedia types. Running webassembly with threads on node js requires the experimental-wasm-threads flag when starting.

Testing

yarn test

Test files should be created with '.test.js' prefix.

How it works

  • A twitter user would tag the bot under a video with @whatsongishere
  • The bot running in a loop(cron job) would listen for its mentions.
  • For any mention found, it checks firstly for if it has attended to this mention before. If it has, it ignores the mention
  • If it hasn't attended to this mention before, it checks the DB if it has been mentioned on that song before. If it has, it uses the same response from before.
  • If it hasn't been mentioned to the video before, it converts the video to the required format and makes a request to the Rapi API's shazam API to recognize it.
  • Depending on the response from shazam(or whatever service integrated) it replies the at with the relevant reply.

whatsongishere-in-action

Currently receiving contributions for Hacktoberfest. PRs are not limited to the issues created.

About

Twitter bot to find what song is playing in a given uploaded twitter video.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 99.5%
  • Other 0.5%