Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1

Thread: XML ideas

  1. #1
    New to the CF scene
    Join Date
    Sep 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    XML ideas

    I know that it's possible to edit a blog in blogspot using the export and import feature in XML. My question is if it's possible to add new blog entries with new date, post title, body and name outside the blogspot platform directly into the XML and import into a new blogspot for example. Here is what i came up but it isn't fully working since i need to validate all parameters and revise the code.
    Code:
    <HTML>
    <HEAD>
    <TITLE>Blogspot XML Generator</TITLE>
    
    <SCRIPT LANGUAGE = "JavaScript">
    <!-- Begin
    var email = GetCookie('email_address');
    if (email == null) {
    email = 'your email here';
    }
    function getCookieVal (offset) {
    var endstr = document.cookie.indexOf (";", offset);
    if (endstr == -1)
    endstr = document.cookie.length;
    return unescape(document.cookie.substring(offset, endstr));
    }
    function GetCookie (name) {
    var arg = name + "=";
    var alen = arg.length;
    var clen = document.cookie.length;
    var i = 0;
    while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
    return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0)
    break;}
    return null;}
    function SetCookie (name, value) {var argv = SetCookie.arguments;
    var argc = SetCookie.arguments.length;
    var expires = (argc > 2) ? argv[2] : null;
    var path = (argc > 3) ? argv[3] : null;
    var domain = ".internet.com";
    // (argc > 4) ? argv[4] : null;
    var secure = (argc > 5) ? argv[5] : false;
    document.cookie = name + "=" + escape (value) +
    ((expires == null) ? "" : ("; expires=" +
    expires.toGMTString())) +
    ((path == null) ? "" : ("; path=" + path)) +
    ((domain == null) ? "" : ("; domain=" + domain)) +
    ((secure == true) ? "; secure" : "");}
    // End -->
    </SCRIPT>
    </HEAD>
    
    <BODY BGCOLOR=#ffffff vlink=#0000ff>
    
    <P>
    <center>
    
    	
    <P>
    
    <BASEFONT SIZE=3>
      <FONT SIZE=6>
    
    </B><BR>
      </FONT>
    <center>
    <br>
    <SCRIPT TYPE="text/javascript">
    var nVer = navigator.appVersion;
    var fullVersion = parseFloat(nVer);
    if (fullVersion < 4) { document.write("<DIV ALIGN=\"CENTER\">You can download there the newest Versions for free.</DIV>")
    }
    else
    {
    if(navigator.appName == "Microsoft Internet Explorer")
    {
    size = 35;
    size2 = 76;
    size3 = 118;
    sea = 40;
    tex = 90;
    fon = "X-SMALL";
    fon2 = "XX-SMALL";
    }
    else
    {
    sea = 25;
    tex = 80;
    fon = "SMALL";
    fon2 = "X-SMALL";
    size = 26;
    size2 = 53;
    size3 = 81
    }
    Basic = true;
    Okay = false;
    Sayfa = 0;
    star = 0;
    Generator = 0;
    Generator2 = 0;
    sifre = 0;
    duzen = 0;
    document.write("<STYLE TYPE=\"text/css\">BODY{BACKGROUND-COLOR:#E0E0E0}TD{COLOR:#333333;FONT-SIZE:" + fon2 + ";FONT-FAMILY:Ms Sans Serif}A:LINK{COLOR:#000099;TEXT-DECORATION:NONE}A:VISITED{COLOR:#000099;TEXT-DECORATION:NONE}A:ACTIVE,A:HOVER{COLOR:#000000}SPAN.HEA{COLOR:#000000;FONT-FAMILY:VERDANA;FONT-SIZE:LARGE;FONT-STYLE:ITALIC;FONT-WEIGHT:BOLD}SPAN.HEA2{COLOR:#FF0000;FONT-FAMILY:VERDANA;FONT-SIZE:LARGE;FONT-STYLE:ITALIC;FONT-WEIGHT:BOLD}SPAN.VERS{COLOR:#666666;FONT-FAMILY:VERDANA;FONT-SIZE:" + fon + ";FONT-WEIGHT:BOLD}</STYLE></HEAD><BODY>")
    document.write("<FORM><TABLE BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"0\" ALIGN=\"CENTER\"><TR><TD COLSPAN=\"3\" ALIGN=\"CENTER\"><SPAN CLASS=\"HEA\">Blogspot XML Generator&nbsp;&nbsp;</SPAN><SPAN CLASS=\"VERS\">Version: 1.0</SPAN><br><br><br><br><br><br></TD></TR><TR><TD COLSPAN=\"3\"><TEXTAREA NAME=\"Machine\" COLS=\"" + tex + "\" ROWS=\"5\"></TEXTAREA></TD></TR><TR><TD><INPUT TYPE=\"BUTTON\" VALUE=\"START\" onClick=\"basla()\">  <INPUT TYPE=\"BUTTON\" VALUE=\"Clear\" onClick=\"Clear()\"> </TD><TD COLSPAN=\"2\" ALIGN=\"RIGHT\">")
    if(navigator.appName == "Microsoft Internet Explorer")
    {
    document.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<INPUT TYPE=\"TEXT\" SIZE=\"20\" NAME=\"SAYFA\" onFocus=\"document.forms[0].Machine.focus();\" style=\"background-color: #E0E0E0; color: #666666; font-family: Ms Sans Serif; font-size: xx-small; font-weight: bold; border: medium solid #E0E0E0\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<INPUT TYPE=\"TEXT\" SIZE=\"18\" NAME=\"BYTES\" VALUE=\"Total Bytes: \" onFocus=\"document.forms[0].Machine.focus();\" style=\"background-color: #E0E0E0; color: #666666; font-family: Ms Sans Serif; font-size: xx-small; font-weight: bold; border: medium solid #E0E0E0\">&nbsp;")
    }
    else
    {
    document.write("&nbsp;")
    }
    document.write("</TD></TR><TR><TD HEIGHT=\"45\" VALIGN=\"BOTTOM\"><br><B>Time: (2013-04-30T16:42:43.153-07:00)</B><BR><INPUT NAME=\"URL\" SIZE=\"" + size + "\"><br><B>Post Title: (The Walking Dead, Season 3, Episode 16)</B><BR><INPUT NAME=\"TITLE\" SIZE=\"" + size2 + "\"><br><B>iFrame Embed Code: (http://www.sockshare.com/embed/C7D43A587DF12238)</B><BR><INPUT NAME=\"DESCRIPTION\" SIZE=\"" + size2 + "\"><br><B>Poster Name: (Movie Fan)</B><BR><input type=\"text\" NAME=\"TEXT\" SIZE=\"" + size2 + "\"><BR><INPUT TYPE=\"BUTTON\" VALUE=\"Add This Post\" ONCLICK=\"uygula();\"> </TD></TR><TR><TD VALIGN=\"BOTTOM\"></TD></TR><TR><TD COLSPAN=\"2\" VALIGN=\"BOTTOM\" HEIGHT=\"40\">")
    document.write("</TD><TD ALIGN=\"RIGHT\" VALIGN=\"BOTTOM\"></TD></TR></TABLE></FORM>")
    
    
    function Clear()
    {
    if(Basic)
    {
    Okay = true;
    {
    if(navigator.appName == "Microsoft Internet Explorer")
    {
    document.forms[0].GeriAl.disabled = false;
    }
    Value1 = document.forms[0].Machine.value;
    document.forms[0].Machine.value = "";
    document.forms[0].URL.value = "";
    document.forms[0].TITLE.value = "";
    document.forms[0].DESCRIPTION.value = "";
    document.forms[0].TEXT.value = "";
    document.forms[0].MAIL.value = "";
    document.forms[0].ELINK.value = "";
    document.forms[0].ISIM.value = "";
    }
    }
    }
    function Bytes()
    {
    document.forms[0].BYTES.value = "Total Bytes: " + document.forms[0].Machine.value.length;
    setTimeout("Bytes()","3000")
    }
    if(navigator.appName == "Microsoft Internet Explorer")
    {
    Bytes();
    }
    function Sayfalar()
    {
    if(Sayfa == 0)
    {
    Say = "";
    sayf = "";
    }
    else
    {
    Say = Sayfa
    }
    if(Sayfa == 1)
    {
    sayf = "Page was added"
    }
    if (Sayfa >= 2)
    {
    sayf = "Pages were added"
    }
    document.forms[0].SAYFA.value = Say + " " + sayf;
    setTimeout("Sayfalar()","1")
    }
    if(navigator.appName == "Microsoft Internet Explorer")
    {
    Sayfalar();
    }
    function basla()
    {
    if (document.forms[0].Machine.value != "")
    {
    alert("For a new Start you must delete the current document first !")
    }
    else
    {
    var doc = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"><HTML><HEAD><META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset= iso-8859-1\"><TITLE>Search Machine<\/TITLE><SCR"+"IPT TYPE=\"text\/javascript\">Cy=new Array();";
    document.forms[0].Machine.value += doc;
    document.forms[0].Machine.focus();
    document.forms[0].GeriAl.disabled = true;
    {
    if (star == 0)
    {
    confirm("C O N G R A T U L A T I O N S  !\n\nThe Basics were added.\n\nFrom now on, fill in the fields an press the  GET  CODE  button !")
    }
    star += 1;
    Generator = 0;
    Generator2 = 0;
    Sayfa = 0;
    sifre = 0;
    }
    }
    }
    function Taglar(DOk)
    {
    Cy = DOk.indexOf("<");
    cY = DOk.indexOf(">");
    Taglar2 = DOk.length;
    Cc = DOk.substring(0, Cy);
    if(cY == -1)
    cY = Cy;
    cC = DOk.substring((cY + 1), Taglar2);
    Son1 = Cc + cC;
    CccY = Son1.indexOf("<");
    if(CccY != -1)
    Son1 = Taglar(Son1);
    return Son1;
    }
    function sifrele()
    {
    if (sifre >= 1 && Generator >= 1 )
    {
    alert ("This function works only once !")
    }
    if (Generator == 0 )
    {
    confirm ("PROTECT CODE  function works only when the complete code is generated.")
    }
    Value1 = document.forms[0].Machine.value;
    if (Generator == 1 && sifre == 0 )
    {
    if(Basic)
    {
    Okay = true;
    if (confirm ("This function of  Search Machine  protects the code completely.\n\nBut it is nearly impossible to edit the code then !\n\nUse this option only when you do not want to make any more changes to the code."))
    {
    if(navigator.appName == "Microsoft Internet Explorer")
    {
    document.forms[0].GeriAl.disabled = false;
    }
    Code = escape(document.forms[0].Machine.value)
    
    document.forms[0].Machine.focus();
    sifre += 1;
    alert("haaaaaaaaaahhhhhhhhhh ............\n\nYour Code is completely protected now.\n\nYou may restore the normal version by using the  UNDO  button.")
    }
    else
    {
    document.forms[0].Machine.focus();
    }
    }
    }
    }
    function bosluk()
    {
    if (document.forms[0].Machine.value.length < 222 && star == 0)
    {
    return false
    }
    else
    {
    var tit = "";
    var desc = "";
    var Metin = "";
    var tus1;
    var tus2;
    var tus3;
    var uzluk1 = document.forms[0].TITLE.value.length;
    var uzluk2 = document.forms[0].DESCRIPTION.value.length;
    var uzluk3 = document.forms[0].TEXT.value.length;
    for(var i1 = 0; i1 < uzluk1; i1++)
    {
    tus1 = document.forms[0].TITLE.value.charAt(i1);
    if( tus1 <= " ")
    {
    if( document.forms[0].TITLE.value.charAt(i1+1) != " ")
    tit += " ";
    }
    else if( tus1 == "\"" )
    {		
    i1++;
    tit += "&quot;";
    }
    else if( tus1 == "<" )
    {		
    i1++;
    tit += "&lt;";
    }
    else if( tus1 == ">" )
    {		
    i1++;
    tit += "&gt;";
    }
    else
    {
    tit += document.forms[0].TITLE.value.charAt(i1);
    }
    }
    document.forms[0].TITLE.value = tit;
    for(var i2 = 0; i2 < uzluk2; i2++)
    {
    tus2 = document.forms[0].DESCRIPTION.value.charAt(i2);
    if( tus2 <= " ")
    {
    if( document.forms[0].DESCRIPTION.value.charAt(i2+1) != " ")
    desc += " ";
    }
    else if( tus2 == "\"" )
    {		
    i2++;
    desc += "&quot;";
    }
    else if( tus2 == "<" )
    {		
    i2++;
    desc += "&lt;";
    }
    else if( tus2 == ">" )
    {		
    i2++;
    desc += "&gt;";
    }
    else
    {
    desc += document.forms[0].DESCRIPTION.value.charAt(i2);
    }
    }
    document.forms[0].DESCRIPTION.value = desc;
    for(var i3 = 0; i3 < uzluk3; i3++)
    {
    tus3 = document.forms[0].TEXT.value.charAt(i3);
    if( tus3 <= " ")
    {
    if( document.forms[0].TEXT.value.charAt(i3+1) != " ")
    Metin += " ";
    }
    else if( tus3 == "\"" )
    {		
    i3++;
    Metin += "&quot;";
    }
    else if( tus3 == "<" )
    {		
    i3++;
    Metin += "&lt;";
    }
    else if( tus3 == ">" )
    {		
    i3++;
    Metin += "&gt;";
    }
    else
    {
    Metin += document.forms[0].TEXT.value.charAt(i3);
    }
    }
    document.forms[0].TEXT.value = Metin;
    }
    }
    function uygula()
    {
    if (document.forms[0].Machine.value.length < 222 )
    {
    alert("Please, click the  START  button before adding pages!")
    }
    else if ( Generator > 0 )
    {
    alert ("           IT 's  ALLREADY  DONE !\n\nThe Code can be generated only once,\n\nUse the PREVIEW button to view your new page.")
    }
    else if (Sayfa >= 8)
    {
    alert ("Sorry ....!!!  This Demo Version of Search Machine,\n\ngenerates up to 8 pages only !")
    }
    else if ((document.forms[0].URL.value == "")||(document.forms[0].URL.value == "http://"))
    {
    alert("Please fill in the  URL  Address field !\n\nInclude \" http:// \" for external links only !")
    }
    else if (document.forms[0].TITLE.value == "")
    {
    alert("Please fill in the  TITLE  field !")
    }
    else if (document.forms[0].DESCRIPTION.value == "")
    {
    alert("Please fill in the  DESCRIPTION  field !")
    }
    else if (document.forms[0].TEXT.value == "")
    {
    alert("Please fill in the  TEXT  field !")
    }
    else
    {
    if(Basic)
    {
    Okay = true;
    if (confirm (("Page  # ") + (Sayfa + 1) + ("  will be added.")))
    {
    if(navigator.appName == "Microsoft Internet Explorer")
    {
    document.forms[0].GeriAl.disabled = true;
    }
    
    Sayfa += 1;
    var say = (""); 
    var ur=document.forms[0].URL.value; 
    var url=("<entry><id>tag:blogger.com,1999:blog-5056607706428447745.post-9199658274736909223</id><published>" + ur + "</published><updated>" + ur + "</updated><category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/blogger/2008/kind#post'/><title type='text'>"); 
    var titl=document.forms[0].TITLE.value; 
    var title = ("\"A\"") + titl; 
    var descript = document.forms[0].DESCRIPTION.value;
    var description = ("</title><content type='html'>&lt;iframe src=\"") + descript; 
    var bod=document.forms[0].TEXT.value; 
    var TeXt = ("\" width=\"600\" height=\"360\" frameborder=\"0\" scrolling=\"no\"&gt;&lt;/iframe&gt;</content><link rel='replies' type='application/atom+xml' href='#' title='Send Comment'/><link rel='replies' type='text/html' href='#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5056607706428447745/posts/default/9199658274736909223'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5056607706428447745/posts/default/9199658274736909223'/><link rel='alternate' type='text/html' href='#' title=''/><author><name>" + bod + "</name><uri>#</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry>);");
    
    Value1 = document.forms[0].Machine.value;
    document.forms[0].URL.value = "";
    document.forms[0].TITLE.value = "";
    document.forms[0].DESCRIPTION.value = "";
    document.forms[0].TEXT.value = "";
    document.forms[0].Machine.value += say + url + titl + description + TeXt;
    document.forms[0].Machine.focus();
    }
    else
    {
    document.forms[0].Machine.focus();
    }
    }
    }
    }
    
    }
    </SCRIPT>
    </center>
    </FONT>
    Last edited by vinyl-junkie; 09-14-2013 at 04:16 AM. Reason: removed self-promotional link; added code tags


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •