Jump to content

Good way to get a song entry via AJAX (XmlHTTPRequest)


Broken One

Recommended Posts

Exactly, what I'm trying to do is to incorparate those songfacts dynamically into the HTML of last.fm.

If none are given I will place a link so you can add them or comment on the song.

At the moment I can get a detail page via 2 seperate XmlHttpRequests. Worse I have to use regular expressions to parse the HTML I get.

This would be easier if there would be some kind of API that takes an artist and a track and returns some XML document. So my question is if there is any better way or hidden way to query the songfacts database.

Greets,

Broken One

Link to comment
Share on other sites

No offense, but you should inform yourself of the capabilities of Greasemonkey it what it exactly is ;)

The whole insertion happens only in your browser via Java Script and XmlHttpRequests. last.fm will never notice and you won't have to ask them to let some code run in your browser^^.

Greets,

Broken One

P.S.: I'm nearly finsihed but I bet it will be rather slow with the whole requests and regexps.

Link to comment
Share on other sites

I have a working beta, now. It is still looking somewhat ugly and I like to redesign it a little bit and add some links to songfacts.

I'm also missing some feedback when there are now songfacts available. What I dislike most is the way I have to search, it seems to work but it is not very good.

As soon as I finished the design and got a link back to songfacts in it I will publish the script on userscripts.org.

I would glady try to incorporate suggestions or add things if you have any suggestions?

Greets,

Broken One

Link to comment
Share on other sites

Hoi, no problem I'm glad to do it and I hope I will create something that some people might find useful.

Yeah if there was an API that I could use with a simple XmlHttpRequest and that would return the unformatted facts as XML oder clean HTML it would be really great.

Greets,

Broken One

Link to comment
Share on other sites

  • 3 weeks later...

Yeah, I talked with some of the technical folk, and while this is possible, it creates the potential for problems, as other sites could easily steal the content if we were to set up some kind of API. It is a real interesting application, but I'm just not comfortable with what it could open up.

Link to comment
Share on other sites

  • 4 weeks later...

One could steal your content with any webcrawler or programmed application. It would be easier with an API, but what about protecting the API so that only people with a login can access or use it?

Sorry that I didn't let you hear anything. I just started studying and had to move to a new city.

As soon as all is back to normal I will try to pretty up my version and get it out!

Greets,

Broken One

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...