Worked around Radio's lame XML encoding support.
This commit is contained in:
parent
fa8a7eae02
commit
76bbb6e781
5 changed files with 85 additions and 94 deletions
|
@ -542,7 +542,7 @@ public class LifeBlogger extends Thinlet
|
|||
setString(find(post, "password"), "text", new String(Base64.decode(_prefs.getProperty("blog-password", ""))));
|
||||
setString(find(post, "entry"), "text",
|
||||
"<img src=\"" + url + "\" alt=\"" + filename +
|
||||
"\">\n<p>via <a href=\"http://www.thauvin.net/erik/lifeblogger/\">LifeBlogger</a></p>");
|
||||
"\">\r<p>via <a href=\"http://www.thauvin.net/erik/lifeblogger/\">LifeBlogger</a></p>");
|
||||
add(post);
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
|
@ -98,13 +98,13 @@ public class LifePost extends LifeAction
|
|||
|
||||
final StringBuffer request =
|
||||
new StringBuffer("<?xml version=\"1.0\"?><methodCall><methodName>blogger.newPost</methodName><params><param><value><string>0a6afffffffaffffffb8ffffff8569474cffffffc778500c03ffffffecffffff876116565a27283bffffffda56</string></value></param><param><value><string>").append(_blogID)
|
||||
.append("</string></value></param><param><value><string>")
|
||||
.append(getLogin())
|
||||
.append("</string></value></param><param><value><string>")
|
||||
.append(getPassword())
|
||||
.append("</string></value></param><param><value><string>")
|
||||
.append(textToXML(_blogEntry))
|
||||
.append("</string></value></param><param><value><boolean>false</boolean></value></param></params></methodCall>");
|
||||
.append("</string></value></param><param><value><string>")
|
||||
.append(getLogin())
|
||||
.append("</string></value></param><param><value><string>")
|
||||
.append(getPassword())
|
||||
.append("</string></value></param><param><value><string>")
|
||||
.append(textToXML(_blogEntry))
|
||||
.append("</string></value></param><param><value><boolean>false</boolean></value></param></params></methodCall>");
|
||||
final URLConnection urlConn = url.openConnection();
|
||||
urlConn.setDoInput(true);
|
||||
urlConn.setDoOutput(true);
|
||||
|
@ -117,6 +117,8 @@ public class LifePost extends LifeAction
|
|||
dos.flush();
|
||||
dos.close();
|
||||
|
||||
System.out.println(request);
|
||||
|
||||
final LifeRPCResponse xmlrpc = new LifeRPCResponse(urlConn.getInputStream());
|
||||
|
||||
if (xmlrpc.isValidResponse())
|
||||
|
@ -157,38 +159,20 @@ public class LifePost extends LifeAction
|
|||
return ("<");
|
||||
}
|
||||
|
||||
// Convert left bracket
|
||||
else if (ch == '>')
|
||||
{
|
||||
return (">");
|
||||
}
|
||||
|
||||
// Convert ampersand
|
||||
else if (ch == '&')
|
||||
{
|
||||
return ("&");
|
||||
}
|
||||
|
||||
// High-ASCII character
|
||||
else if (ch >= 128)
|
||||
// High/Low-ASCII character
|
||||
else if (ch >= 128 || ch < 32)
|
||||
{
|
||||
c = (int) ch;
|
||||
|
||||
return ("&#" + c + ';');
|
||||
}
|
||||
|
||||
// Convert double quote
|
||||
else if (ch == '"')
|
||||
{
|
||||
return (""");
|
||||
}
|
||||
|
||||
// Convert single quote
|
||||
else if (ch == '\'')
|
||||
{
|
||||
return ("'");
|
||||
}
|
||||
|
||||
// No conversion
|
||||
else
|
||||
{
|
||||
|
|
|
@ -98,7 +98,14 @@ public class LifeRPCResponse extends Thinlet
|
|||
{
|
||||
final Object string = getDOMNode(value, "string", 0);
|
||||
|
||||
_response = getDOMText(string);
|
||||
if (string == null)
|
||||
{
|
||||
_response = getDOMText(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
_response = getDOMText(string);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Created by JReleaseInfo AntTask from Open Source Competence Group */
|
||||
/* Creation date Sat Jul 24 05:15:28 PDT 2004 */
|
||||
/* Creation date Sat Jul 24 07:57:19 PDT 2004 */
|
||||
package net.thauvin.lifeblogger;
|
||||
|
||||
import java.util.Date;
|
||||
|
@ -12,21 +12,21 @@ import java.util.Date;
|
|||
public class ReleaseInfo {
|
||||
|
||||
|
||||
/** buildDate (set during build process to 1090671328718L). */
|
||||
private static Date buildDate = new Date(1090671328718L);
|
||||
/** buildDate (set during build process to 1090681039640L). */
|
||||
private static Date buildDate = new Date(1090681039640L);
|
||||
|
||||
/**
|
||||
* Get buildDate (set during build process to Sat Jul 24 05:15:28 PDT 2004).
|
||||
* Get buildDate (set during build process to Sat Jul 24 07:57:19 PDT 2004).
|
||||
* @return Date buildDate
|
||||
*/
|
||||
public static final Date getBuildDate() { return buildDate; }
|
||||
|
||||
|
||||
/**
|
||||
* Get buildNumber (set during build process to 107).
|
||||
* Get buildNumber (set during build process to 110).
|
||||
* @return int buildNumber
|
||||
*/
|
||||
public static final int getBuildNumber() { return 107; }
|
||||
public static final int getBuildNumber() { return 110; }
|
||||
|
||||
|
||||
/** version (set during build process to "0.1.0"). */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue