欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

asp javascript picasa相冊(cè)外鏈批量導(dǎo)出

 更新時(shí)間:2009年05月02日 13:08:42   作者:  
自己的空間想做一個(gè)相冊(cè),找來(lái)找去用了picasa,功能很方便,唯一不足之處是獲取外鏈太麻煩,一個(gè)一個(gè)的復(fù)制粘貼太辛苦,于是用asp+javascript的方法寫(xiě)了個(gè)簡(jiǎn)單的程序
來(lái)與大家分享。稍加改造就可以實(shí)現(xiàn)更強(qiáng)大的功能了。
用下面的代碼就可以簡(jiǎn)單的批量導(dǎo)出picasa相冊(cè)的外鏈了。
復(fù)制代碼 代碼如下:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
    dim xmlget,xmlhttp,email,paswd
    email="youremail"    '輸入picasa的賬戶(hù)email
    paswd="yourpassword"    '輸入picasa的密碼
    Set xmlhttp = CreateObject("Msxml2.ServerXMLHTTP")
    With xmlhttp
        .Open "GET", "https://www.google.com/accounts/ServiceLoginAuth?service=lh2&continue=http://picasaweb.google.com/lh/login?continue=http%3A%2F%

2Fpicasaweb.google.com%2Fhome&ltmpl=gp&h1=zh_CN&GALX=ip37cq7CgwE&Email="&email&"&Passwd="&paswd, False
        '.setRequestHeader "CONTENT-TYPE","application/x-www-form-urlencoded"
        .Send ""
        xmlget = getRedirect(bin2str(.responseBody))

        .Open "GET", xmlget
        .Send ""
        xmlget = bin2str(.responseBody)

        if request("type")="photo" then
            .Open "GET", request("url")
            .Send ""
            xmlget = bin2str(.responseBody)
            xmlget = Replace(xmlget, "pwa.setup", "test2")
        else
            xmlget = Replace(xmlget, "pwa.setup", "test")
        end if
    End With
    set xmlhttp = nothing

    Function bin2str(binstr)
        Const adTypeBinary = 1
        Const adTypeText = 2
        Dim BytesStream,StringReturn
        Set BytesStream = Server.CreateObject("ADODB.Stream")
        With BytesStream
            .Type = adTypeText
            .Open
            .WriteText binstr
            .Position = 0
            .Charset = "UTF-8"
            .Position = 2
            StringReturn = .ReadText
            .Close
        End With
        Set BytesStream = Nothing
        bin2str = StringReturn
    End Function

    Function getRedirect(str)
        str = Mid(str, Instr(str, "location.replace"))
        str = Mid(str, 19, Instr(str, """)")-19)
        str = Replace(str, "\x3d", "=")
        getRedirect = Replace(str, "\x26", "&")
    End Function
%>

<%
    if request("type")<>"photo" then
%>
<script language="javascript"><!--
    function test()
    {
        if(arguments.length != 8)
            return;
        var html = "<ul>";
        var albums = arguments[3];
        for (var i=0;i<albums.length;i++)
            html+="<li><a href='http://<%=Request.ServerVariables("Server_Name")&Request.ServerVariables("SCRIPT_NAME")%>?type=photo&url="+escape(albums

[i].url)+"'>"+albums[i].title+"</a></li><br/><img src=""+albums[i].src+"" src="&quot;+albums[i].src+&quot;"/>";
        html+="</ul>";
        document.body.innerHTML=html;
    }
// --></script>
<%
    else
%>
<script language="javascript"><!--
    function test2()
    {
        if(arguments.length != 15)
            return;
        var html = "<ul>";
        var photoes = arguments[6].feedPreload.feed.entry;
        for (var i=0;i<photoes.length;i++)
            html+="<li>"+photoes[i]["content$src"]+"</li>";
        html+="</ul>";
        document.body.innerHTML=html;
    }
// --></script>
<%
    end if
%>
<%=xmlget%>

將上面的代碼里picasa的用戶(hù)名密碼改好,保存成ASP文件,放到服務(wù)器下訪(fǎng)問(wèn),就可以看到效果了。

相關(guān)文章

最新評(píng)論