Music
 

LyricWiki talk:SOAP/Archive/2006 1

From LyricWiki

Archive This page is an archive of past discussions. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current LyricWiki talk page.
LyricWiki talk archive for SOAP
  2006 2007 >>

Contents

[edit] getLyrics vs. getSong

Why is the method to get a lyric listed as getLyrics on this page, but implemented as getSong? Or is the getLyrics function meant for something different? - Florob 14:29, 17 September 2006 (PDT)

I just forgot to change the documentation after implementing it (it's fixed now). Thanks for catching this!
-Sean Colombo 14:38, 17 September 2006 (PDT)

[edit] Accessing the SOAP web service from javascript

Discussion moved from User talk:Sean Colombo

Hi, Is there a way you can query the web service with all the parameters and the soap action (ex: getSong) listed in url format: For example: http://lyricwiki.org/server.php?wsdl&method=getSong&artist=artist&song=song ?

The reason I ask is that I'm trying to access the web service using the activex object "Microsoft.XMLHTTP" and javascript.

Or are there other ways to access it using javascript?

/ThePike

Hi ThePike... there isn't a way to do that yet (which just means that you are the first to ask for it, it wouldn't be hard to do). Are you comfortable POSTing with AJAX or just with GETs? (generally it's stanadard to make requests use GET, but things where you are sending data (like updating lyrics) use POST).
I'm sure I can get this set up soon for you (how close is your site/page to being done?). If you have a link to what you're doing so that I can understand it better, that's always appreciated too :)
Thanks,
-Sean Colombo 20:00, 5 December 2006 (EST)
Ok I see. I'm working on a Windows Vista sidebar gadget that displays the current album cover (from amazon) for playing song in winamp and
I thought it would be a nice addition to be able to view lyrics too.
Unfortunately there's no project page or similar online.
So there would be only GET requests...
/ThePike
Actually I think I'll go in another direction. I'll create a COM object in C# that uses the web service and just call it from within the gadget.
Will searchSongs() be implemented soon?
Tried the getSong() method and it works fine but it misses many requests due to spelling since it requires an exact match.
Are there any search tips? For example certain characters that are to be left out or replaced?
/ThePike
Hi, there isn't a planned date for the searchSongs() method... there's always so much to do that I just wait till someone asks for it basically :)
So if you need it soon, I can get on it. Usually the getSong() can be made to get most music that actually is on the site (I can never find my instrumental techno on here, lol).
Anyway... the best ways to make sure you get the results you want from getSong() are to follow the naming conventions that mostly go like this:
  1. Capitalize The First Letter Of Every Word
  2. Bands that have "The" should start with "The" so search for "The Prodigy", not "Prodigy, The"
  3. Most of the time remove parenthesis and other extra dashes, etc. from the end of the title. So search for Akon:Smack That not Akon:Smack That (ft. Eminem - dirty version - DJ Clue remix ft. blahhh)
In addition... if you are using getSong() more, instead of working on searchSong() there are some improvements I could do to getSong() that will make more hits likely. Basically, there are a bunch of mispellings/diff capitalizations and abbreviations of bands; we have a ton of redirects on the site that take care of this, but they are only for the artist page... I could make the SOAP understand that if there is no page match, it should look for the artist name that is redirected to by the provided artist name and see if there is a song that matches that.
Ok, that might have been semi-greek, but basically... I can make getSong() better.
-Sean Colombo 16:16, 7 December 2006 (EST)
Ok thanks. Sounds good. A "smarter" getSong() method would be great!
/ThePike
Heya, just remembered that most of those tips (capitalization, etc.) are done by the SOAP itself already. I didn't do the parentheses-choppng yet, but I can do that if the successful-result rate is still low. I started logging the stats yesterday, and this morning I implemented that redirection-trick (therefore botching todays stats since I did it in the middle of the day). By the end of tomorrow, I should know if that really helped much or not.
-Sean Colombo 19:00, 9 December 2006 (EST)


[edit] Janet Jackson - Control: Site is fine, webservice don't

Hello there,
this is a great webservice guys!
I'm having an issue right now, some of the songs can be access through the standard website interface:
http://www.lyricwiki.org/Janet_Jackson:Control
but when you try to call getsongs ("Janet Jackson", "Control") it doesnt return the lyrics.
Any ideas?
Thanks
--Raul

Hi Raul,
I tried it out, and I got the result for Janet Jackson:Control just fine using the webservice... what does it return to you, "No match found" or an error?
-20:17, 30 December 2006 (EST)

[edit] getSong case-sensitive

It seems that getSong is case-sensitive. As an example getSong("Die Ärzte", "Komm zurück (unplugged)") does not return Die Ärzte:Komm Zurück (Unplugged). I think this is a bit suboptimal, because sometimes song capitalisation is not always cleary and misscapitalization is a common mistake. The wiki itself performs the search case-insensitive. Would it be possible to have getSong act case-insensitive? Florob 10:02, 31 December 2006 (EST)

 :( Hmm... it's not supposed to be case-sensitive. There is a function in there that tries to fix all incoming title names to match the standard of the site. I'm not sure whether it's the umlauts or the parenthetical that's messing up the match (it's probably the "u" after the parentheses if I had to make a guess), but I'll look at it and see if I can fix it.
-Sean Colombo 14:22, 31 December 2006 (EST)
FIXED! Sweet... I looked into it more, and it was just the parentheses. I should explain: with the MediaWiki framework, it is relatively easy to check if a page exists... you create the title then call an ->exists() function on it. The catch being that you need the case to be correct since pages in the wiki are case-sensitive. The search page on the wiki is insensitive because it is using mySQL to search through all pages (and mySQL comparisons are case-insensitive by deafult).
It is much faster to just call $title->exists() than to perform our own queries on the various tables (a single page is actually spread over multiple tables... one for the article, one for the content of the page which may or may not be valid and may or may not be an old or deleted revision). Therefore, I wrote a function to take all incoming requests and format them to meet the standards on the site. This includes capitalizing all the words, but PHP's doesn't recognize special characters as word-boundaries, so I had to put in a special case for hyphens and now for parentheses. If you can think of any other time that there would be special (non-space) characters at the beginning of a word, please let me know so I can put that into the SOAP script. Thanks!
-Sean Colombo 20:07, 31 December 2006 (EST)
Cool, seems to work pretty good now (except reaching the server is very slow). Do you handle quotes (" or ') at the beginning of words, or aren't those valid characters?
-Florob 14:24, 2 January 2007 (EST)
The SOAP doesn't do anything special with quotes. If they are actually in the title of the song, they should be in the request too.
-Sean Colombo 22:48, 7 January 2007 (EST)
I had problems fetching lyrics for A-HA. Correcting it to A-Ha worked fine. However I fail with AC/DC, AC/DC, Ac Dc. Any ideas?
-Ronson 13:51, 7 January 2007 (EST)
Hi, I couldn't reproduce the A-ha problem. Did you have this problem today? One of the fixes yesterday involved making even ALL CAPS TITLES WORK. I wouldn't have thought this was an issue, but ucword("HELLO WORLD") yields "HELLO WORLD" so I just changed it to ucword(strtolower("HELLO WORLD")) to get "Hello World". So this isn't supposed to be an issue as of some time yesterday.
As for AC/DC, This problem is caused by the same code (may or may not have) fixed "A-ha". So now the SOAP is looking for Ac Dc:Little Lover instead of AC/DC:Little Lover since AC/DC is technically wrong using our title formatting standard. There's really no way to... fix that since the wiki data made the mysql tables case-sensitive. Normally if the title is weird we'd do a redirect to the other title... but that would mean we'd have to move the pages to Ac Dc due to technical restrictions.
So it appears we have two choices (unless someone can think of another)
  1. Move all pages to work with the standard so that AC DC would be moved to Ac Dc and just look sorta weird but work.
  2. Not allow the SOAP to get results from artists with non-standard-capitalization in their titles.
Thoughts?
-Sean Colombo 22:45, 7 January 2007 (EST)
A-Ha and A-HA now work both. Maybe I tried A-HA already on Saturday evening or Sunday morning and there it didn't work.
I don't understand your second suggestion. Would this mean, that one gets an exception when he queries e.g. A-HA? Does this make sense?
I'm not very much into your way of finding the articles, but wouldn't it be possible to check first for the standard-capitalization article and if none is found, automatically check for the article with artist and song name exactly as the given parameters. E.g. if one checks for AC DC Thunderstruck, you'll convert it to Ac Dc Thunderstruck, you'll find nothing, therefore you'll check for AC DC Thunderstruck find the desired article and return it. Maybe this behaviour should also be controllable with parameters, e.g. labelled "searchMode" (overloads of the methods, or a property?).
-Ronson 13:21, 8 January 2007 (EST)
Another problematic artist concerning capitalization is INXS.
-Ronson 11:46, 15 January 2007 (EST)
... and Lutricia McNeal. To sum it up: There are several artists (and also song titles) which have non-standard capitalization. With the current SOAP-implementation there is NO way (also no cheating) to retrieve the lyrics for these songs. If possible, please consider my comment of 8 January: Implement another query method that avoids automatic capitalization of the query parameters and instead takes them as they are.
-Ronson 12:02, 21 January 2007 (EST)
Yeah, we really have to do something about that. If we made a second version of the function though... you'd call that version every time the original request fails, right? In that case it would be simpler to just add one more check into every failing request to see if the originally capitalized version could be found. I was hesitant to do that earlier since every failing request would now have one another database query... but it seems to be worth it to fix this annoying bug. Do you see any reason that this would be worse/better than making a separate function?
-Sean Colombo 05:31, 22 January 2007 (EST)
Yes, you're right. I would call the separate function everytime the first one fails. So to minimize roundtrip times and - as you said - reduce server load, you should do it in one step at the server. Of course you could check if the spelling given by the user and the capitalized spelling are different at all, before doing the second check. So I don't think two methods are necessary.
Best would be a completely case independent search, and maybe a somewhat "forgiving" search to correct misspelling. But this is probably too resource consuming.
-Ronson 06:07, 22 January 2007 (EST)
I've fixed it so that artist names that are all-capitalized are left in tact since that actually goes with LyricWiki:Page names and fixes the above problems. I was confused... the standard is and always has been to leave names that are all-caps like "AC DC" as all-caps. I've tested the fix and it works (as long as no one is searching for "Ac Dc").
-Sean Colombo 18:23, 22 January 2007 (EST)
Thanks, I'll test it. But that probably does not yet fix issues with Lutricia McNeal or Maria McKee.
-Ronson 04:12, 23 January 2007 (EST)
AC/DC now works (though having problems to fetch AC/DC:T.N.T.).
-Ronson 15:02, 23 January 2007 (EST)
Thanks Sean, now a lot of issues are fixed right now (as far as I can see): Lutricia McNeal, Maria McKee, ZZ Top, etc. now do work. Only few things are real bugs: AC/DC:T.N.T. and also all songs by R.E.M. don't seem to work, so dots seem to be a problem. Furthermore, since you strip off parentheses from requested song titles, some titles cannot be retrieved if the parentheses are part of the song title, e.g. Michael Bublé:A Foggy Day (In London Town). Another application of our "double-search" which we've discussed a couple of times now.
-Ronson 18:54, 23 January 2007 (EST)
Hi. The parentheses are only chopped off if the original title isn't found, so it should behave as expected. I ran a test for Michael Bublé:A Foggy Day (In London Town) and I got a successful result. Did it fail for you or did you not get a chance to test it?
-Sean Colombo 12:07, 24 January 2007 (EST)
It fails for me: Requested song title A Foggy Day (In London Town) and requested artist name Michael Bublé. Maybe a problem with the artists accent? Any ideas for the problems with R.E.M.?
-Ronson 12:15, 25 January 2007 (EST)
Right now even non-critical titles fail like Xavier Naidoo:Sie Sieht Mich Nicht. So probably my previous post is worthless because of fundamental problems.
-Ronson 12:22, 25 January 2007 (EST)
I tested the issues of my last two posts and they are fixed.
-Ronson 07:39, 1 February 2007 (EST)
I seem to have problems getting Lyrics for Die Ärzte:Meine Ex(Plodierte Freundin) right now. My first guess was, that the "p" after the "(" is being capitalized, doesn't make sense if you also search with the original string though...
Florob 18:40, 3 February 2007 (EST)
Fixed. It was the "P".
-Sean Colombo 10:43, 23 April 2007 (EDT)
It fails on Senses Fail - NJ Falls Into the Atlantic -- however Senses Fail:NJ Falls Into The Atlantic works (note the difference in the/The). Remiss 10:18, 27 February 2007 (EST)
My guess is that it was the capital J in NJ that was doing it. The capitalization is fixed and it seems to work now: [1]
-Sean Colombo 10:43, 23 April 2007 (EDT)