asp javascript picasa相簿外鏈大量匯出_應用技巧

來源:互聯網
上載者:User
來與大家分享。稍加改造就可以實現更強大的功能了。
用下面的代碼就可以簡單的大量匯出picasa相簿的外鏈了。
複製代碼 代碼如下:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
    dim xmlget,xmlhttp,email,paswd
    email="youremail"    '輸入picasa的賬戶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=""+albums[i].src+""/>";
        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的使用者名稱密碼改好,儲存成ASP檔案,放到伺服器下訪問,就可以看到效果了。
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.