FANDOM

2,054,170 Pages

Replacement filing cabinet 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
<< 2007 2008 2009 >>

lyric Tags in Lyrics

Hi All, I have noticed in some songs e.g. http://lyricwiki.org/Nine_Inch_Nails:Right_Where_It_Belongs when you fetch the lyrics you will get tags like

<./lyric.>
= = V2 = =
<.lyrics.>

inside the lyrics string. Is there a way to parse this?

Much appreciate pointing me in the right direction. Thanks in advance, McoreD

P.S: I put . in the middle otherwise even this post gets parsed.

Another url showing this: http://lyricwiki.org/api.php?artist=In%20Extremo&song=Davert-Tanz&fmt=xml — The preceding unsigned comment was added by McoreD (talkcontribs), 10:22, 19 January 2008.

This occurs because there are more than one version of this song's lyrics, with different wordings, translations etc. The person who entered the lyrics has listed each version of the lyrics separately. When you find lyrics formatted like this, you need to decide how to handle this depending on what you are using the API for. One simple way would be to use only the first lyrics version (i.e. everything before the first /lyrics tag) and ignore the rest.
Spacejens 23:48, 3 January 2009 (UTC)

Vb.net and german language

I have big problems to parse this site correctly: http://lyricwiki.org/B%C3%B6hse_Onkelz:Dunkler_Ort

Public Function test()
Dim request As HttpWebRequest
Dim response As HttpWebResponse = Nothing
Dim readStream As StreamReader = Nothing
Dim htmlContent As String = ""
Dim url As String = "http://lyricwiki.org/api.php?artist=B%C3%B6hse_Onkelz&song=Dunkler_Ort&fmt=html"
Try
request = DirectCast(WebRequest.Create(url), HttpWebRequest)
request.Credentials = CredentialCache.DefaultCredentials
response = DirectCast(request.GetResponse(), HttpWebResponse)
Dim receiveStream As Stream = response.GetResponseStream()
readStream = New StreamReader(receiveStream, Encoding.UTF8)
htmlContent = readStream.ReadToEnd()
Catch
Finally
If Not response Is Nothing Then response.Close()
End Try
If Not response Is Nothing Then response.Close()
If Not readStream Is Nothing Then readStream.Close()
Dim ret As String = parseLyrics(htmlContent)
Return ret
End Function
Public Function parseLyrics(ByVal html As String)
Dim matches As RegularExpressions.MatchCollection
Dim re As RegularExpressions.Regex
Dim ret As String = ""
re = New RegularExpressions.Regex("'"`UNIQ51ad35d35c57d809-pre-00000002-QINU`"'", RegularExpressions.RegexOptions.Multiline)
matches = re.Matches(html)
If matches.Count > 0 Then
ret = matches(0).Value.Replace("'"`UNIQ51ad35d35c57d809-pre-00000003-QINU`"'", "")
ret = ret.Replace(Chr(10), "
")
ret = ret.Replace(Chr(9), "
")
ret = ret.Replace(Chr(13), "
")
ret = System.Text.Encoding.GetEncoding("UTF-8").GetString(System.Text.Encoding.UTF8.GetBytes(ret))
Else
ret = "No lyrics found."
End If
Return ret
End Function

I don't know why, but all german special letters like 'ä,ö,ü,' and so on are wrong.

solved****
i changed to 
Dim url As String = "http://lyricwiki.org/api.php?artist=B%C3%B6hse_Onkelz&song=Dunkler_Ort&fmt=text"
and everything is ok

— The preceding unsigned comment was added by Messiahs (talkcontribs), 22:30, 11 February 2008.

SOAP fails "all of a sudden"?

I have been accessing the page with PHP for a couple of weeks now and retrieved data via SOAP without problems until about yesterday. Now, all I get returned are the following values:

Result

Array
(
    [artist] => Thursday
    [song] => A Hole in the World
    [lyrics] => Not found
    [url] => http://lyricwiki.org
)

artist and song being correct (capitalized how I posted it though), lyrics and url seem to give me a "Not found" response. The entry clearly exists though, and the script used to work w/o problems until hours ago as well.

PHP-Code

<?php
require_once("nusoap/lib/nusoap.php");

$lyricwiki = array(
    "user" => "e*****e",
    "pass" => "*******",
    "server" => "http://lyricwiki.org/server.php?wsdl"
);

print_r(get_lyrics("Thursday", "A Hole In The World", $lyricwiki));

/**
  * Return the lyrics for a given artist/song pair
  *
  * @author mag. mario rader / k9soft.com
  * @param $artist string artist name
  * @param $tracktitle string track title
  * @param $param array lyricwiki params
  * @return array result
  * @copyright mag. mario rader / k9soft.com
  */
function get_lyrics($artist = false, $tracktitle = false, $params) {
    $client = new soapclient($params['server'], true);

    $err = $client->getError();
    if ($err) {
        //msg
    }
    else {
    	$proxy = $client->getProxy();
    	if(($params['user'] != "") || ($params['pass'] != "")){
            $headers = "<username>" . $params['user'] . "</username><password>" . $params['pass'] . "</password>\n";
    	    $proxy->setHeaders($headers);
    	}
    	
    	$result = $client->call(
    	    'getSong',
    	    array('song' => ucwords(strtolower($tracktitle)), 'artist' => ucwords(strtolower($artist))),
    	    'uri:playlist',
    	    'uri:playlist/getLyrics'
    	);
    }

    if ($client->fault) {
        //msg
    }
    else {
        $err = $client->getError();
        if ($err) {
            //msg
        }
        else {
            return $result;
        }
    }
    
    return false;
}
?>

--Emocide 06:55, 25 February 2008 (EST)

Hi, thanks for reporting this... In the future, the quickest way to get a hold of me if it seems like a problem on LyricWiki's end (and not just general discussion about the API) would be to leave a message on my talk page. I get email-alerts when people change that page.
Anywho... this was a temporary issue due to a bug I had created, then fixed that night. There is more information here.
-Sean Colombo (talk|contribs) 10:43, 26 April 2008 (EDT)

Please correct the Encoding-Handling

The Server got a big Problem: If you request a document and use "ISO 8859-1" as Encoding in the Request-Header, the server answers with a encoding of "ISO 8859-1" (both in HTTP-Header and XML-Document). The big problem is: The lyrics ARE acutaly encoded in UTF-8, so the whole XML-File is not valid at all because it claims to be ISO 8859-1 but is in fact UTF-8, at least the lyrics. Please fix this, because this might be the problem for the ruby, perl and other clients. Theomega 05:15, 25 April 2008 (EDT)

Hmm... interesting problem. The lyrics themselves are actually UTF-8 though and I don't think they can be accurately put into ISO 8859-1 all the time if they're stored in utf8 (or can they?). So is the correct solution just to utf8-decode the results and shoot them out, or is there a place to set which encodings are accepted. If ISO 8859-1 is fine with international characters then I guess I can just set the encoding of the response to match the request and it should just work. Do you happen to know?
-Sean Colombo (talk|contribs) 07:27, 25 April 2008 (EDT)
The following solution would imho be the best: Use UTF-8 everytime on response (for ALL responses, regardless of the request-encoding). So send UTF-8 and also declare the document as UTF-8. Imho this is the only solution which will guarantee that every character entered here is send out as a soap-response. --Theomega12:05, 1 May 2008 (EDT)

I try many hours finally found out it was server side's problem. The text format is good, but XML, HTML format is bad. Ex.text_correctXML_wrongHTML_wrong--Tomin 17:32, 9 May 2008 (EDT)

Thank you for the links, they are very helpful in testing. I'm kind of confused because any time I fix those songs, it is breaking other languages. It appears that different inputs will need to be handled differently. For instance, French, Mandarin? (is that the language you provided?), and Czech all appear to give completely different results.
For my own reference, here are a bunch of different links. Once they ALL work, then the system is probably working correctly:
-Sean Colombo (talk|contribs) 20:50, 8 June 2008 (EDT)
Yes, they are Mandarin. Thanks, Sean. I'm so happy it works now. But 'artist' and 'song' tag in XML are still question marks(????). example--Tomin 10:41, 10 June 2008 (EDT)
Just had another report about encoding issues... turns out the "Not Found" doesn't return UTF-8 header. Added to list of test-cases.
-Sean Colombo (talk|contribs) 14:34, 21 July 2008 (EDT)
Fixed. -Sean Colombo (talk|contribs) 23:20, 21 July 2008 (EDT)
Sweet! I'm declaring victory now :-D! Hopefully that isn't too premature, but of all of the test-cases above, they all work now (some results will be bad in the cache for the next 5 hours but that will fix itself). If anyone finds any problems with the encoding stuff, please let me know as soon as possible on my talk page so I can jump on it while this stuff is still fresh in my mind.
Thanks to everyone for the detailed bug reports and for your patience as I really dragged my feet trying to figure this one out.
-Sean Colombo (talk|contribs) 23:20, 21 July 2008 (EDT)

Yet another encoding issue

I'm using Orcas WCF in .NET 3.0 to create proxies and connect to your webservice.

I DO use UTF-8 encoding in request, but the response is always been returned in ISO 8859-1. The problem is: the WCF engine does not support ISO 8859-1 encoding for message exchange. Can you fix this, please?

This is the same issue as above, but nevertheless it should be fixed fast! Theomega 11:33, 8 May 2008 (EDT)
NOTE: Just to tie up the lose-ends - I'm pretty sure this part of the problem has been fixed. There are more encoding problems though. See this thread above for more info.
-Sean Colombo (talk|contribs) 14:42, 21 July 2008 (EDT)

Weird messages on top of lyrics?

I am getting weird messages on top of lyrics from the api. Like: Doors polyphonic ringtones Doors sheet music Concert tickets

See: [1] — The preceding unsigned comment was added by 213.10.65.37 (talk), 12:02, 14 June 2008.

I checked it out, those lines were actually on the page. My guess is that someone pasted the lyrics from another site which had that at the top of it. I've fixed it now for that song.
Thanks for the head's-up,
-Sean Colombo (talk|contribs) 08:37, 14 June 2008 (EDT)

Another encoding problem

It seems that the encoding problem happened again...
Below is a simple script to test the encoding problem related to Chinese Characters(and Japanese too)
the URL to this lyrics is http://lyricwiki.org/陶喆:小镇姑娘 ,you can compare the output of the script to the original lyrics.:
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import urllib
from ZSI import ServiceProxy
artist = "陶喆"
title = "小镇姑娘"
wsdlFile = "http://lyricwiki.org/server.php?wsdl"
lyricServer = ServiceProxy.ServiceProxy(wsdlFile)
lyrics = lyricServer.getSong(artist=urllib.quote(artist), song=urllib.quote(title))['return']["lyrics"]
print lyrics

Yegle 07:44, 17 June 2008 (EDT)

Hello??Anybody there??Yegle 11:25, 21 June 2008 (EDT)
Sorry for not replying. If you ever don't hear from me, please leave a message on my talk page which will send me an email-alert.
I'm working on the encoding issues right now... it seems to be a total mess where I can't fix one set of languages without breaking another set. Gonna keep hammering away at it and hopefully it'll come together.
I'm going to keep track of the progress in this thread. Sorry for the delays.
-Sean Colombo (talk|contribs) 14:40, 21 July 2008 (EDT)

Trouble

Just about every page this user created through SOAP has severe problems. (The most recent ones all have {{Song|A (A)|A}} in the song template, and several feature no lyrics at all.) I don't know if it's SOAP's fault or the user's or a combination of both; but it would be good if someone who Knows Stuff could look into it. -- 6x9 (Talk) 23:32, 14 November 2008 (UTC)

This problem seems to be fixed now as far as I can see. I checked some of the songs, and they were all fixed. Does anyone know of any remaining problems? If not, I will archive this entry in a week or so.
Spacejens 23:56, 3 January 2009 (UTC)

Non-ASCII problems

  • Copied from Community Portal

Does anyone know why soap give broken "umlauts" at this song: Nocte Obducta:Honig Der Finsternis - Phiala Vini Blasphemiae? It has no prob with other german umlauts at the moment, so, what is this? --MetalSnake 23:56, 30 December 2008 (UTC)

I tried this too, yes SOAP is broken with regards to accents (apparently only at this song), here's the link Accent Mashup hopefuly this gets more exposure here. ∃cho⚡ierr∀ () 03:44, 3 January 2009 (UTC)
So, does anyone have a solution for this riddle? --MetalSnake 03:07, 11 January 2009 (UTC)
This looks like a bug with SOAP and "-" charcater in the file name. try this page Accents OK, the only diff is absence of "-" in page name. Hopefully Sean will get around to it soon. cheers ∃cho⚡ierr∀ () 14:53, 13 January 2009 (UTC)
WTF? This one is weird. I don't really see how the hyphen in the title would affect it and yet I can't detect exactly what's different. Hopefully open-sourcing the API soon though... maybe another few dozen sets of eyes would help this out.
-Sean Colombo (talk|contribs) 22:20, 16 January 2009 (UTC)
Certainly baffling, since SOAP has no probs with R-->L writing (Arabic), or other German pages. Another easily reproducable example is Teutonic:Teutonic Tale - Test which I just made up from a real working German page, notice the mangled accents. ∃cho⚡ierr∀ () 02:54, 17 January 2009 (UTC)
So strange. One thing I'm seeing that might be a hint is that when I have "test=encoding" turned on, I see that debug output twice. That would mean that getSong() is somehow being called twice. That's probably not the cause of what's going on, but another side-effect that should be a good hint.
Broken: [2] [3] [4]
Control: [5] [6]
-Sean Colombo (talk|contribs) 07:52, 17 February 2009 (UTC)
Fixed. Long story :P
Thanks for finding that problem though... that was pretty obscure & I'm glad you guys connected the dots on the hyphen being the problem; that made it a lot easier to figure out what was wrong.
-Sean Colombo (talk|contribs) 08:30, 17 February 2009 (UTC)
Community content is available under Copyright unless otherwise noted.