Frick / ttplus

Turntable Plus - a fan-made Chrome Extension!
http://turntableplus.fm
48 stars 16 forks source link

Last.fm Support #22

Closed excid3 closed 1 year ago

excid3 commented 12 years ago

The only thing I'm missing from this is last.fm support. Turntable.fm Extended does a nice job of this, but it'd be great if that functionality was also included in ttplus.

pberry commented 12 years ago

I'll +1 that

dotproto commented 12 years ago

Are you looking to scrobble the tracks you're listening to, or do you want some other Last.fm functionality?

excid3 commented 12 years ago

Just scrobbling is all. I love that functionality from TT.fm Extended, don't really need anything else since linking to the track on last.fm is builtin to TT.

I'm not familiar with how to setup scrobbling, otherwise I'd have submitted with a pull request.

dotproto commented 12 years ago

I'm not familiar with the Last.fm API -- I'll try to take a look at it tonight to figure out what this would require.

dotproto commented 12 years ago

A quick search turned up https://github.com/clifff/javascript-last.fm-api. It seems like it wouldn't be too hard to set up a scrobble call after ~1/2 a song or so. @excid3, if you have the bandwidth it wouldn't hurt to fork and try to implement :)

excid3 commented 12 years ago

Unfortunately the readme says "Scrobbling is not yet supported.". :disappointed:

dotproto commented 12 years ago

Curious. I picked that fork because there was a commit that referenced scrobbling:

https://github.com/clifff/javascript-last.fm-api/commit/9f917eec2800ecd97adf5c4e2c9ff557a53c90c6

excid3 commented 12 years ago

Yeah, looking at the source seems like it supports scrobbling. Maybe the readme just needs updating. I'll see if I can take a look sometime this weekend.

pberry commented 12 years ago

Also can check out the source for tt-extended https://github.com/MarkReeder/Turntable.fm-Extensions and how they do it.

pberry commented 12 years ago

Again, thanks for checking into this!

excid3 commented 12 years ago

Well it's definitely doable. The only problem is that I'm pretty not very good at javascript. :smile:

The code in the javascript API is writing an iframe that makes the POST request to submit the scrobble. If I'm understanding correctly...that's causing this:

Error during tabs.executeScript: Cannot access contents of url "data:text/html,chromewebdata". Extension manifest must request permission to access this host. 

but when the scrobble happens, I'm also getting a 403 forbidden to http://ws.audioscrobbler.com/2.0/ which is the Lastfm API.

Any ideas on what I should be looking at?