欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

asp javascript picasa相册外链批量导出

程序员文章站 2023-02-19 14:18:49
来与大家分享。稍加改造就可以实现更强大的功能了。用下面的代码就可以简单的批量导出picasa相册的外链了。 复制代码 代码如下:<%@language="vbscri...
来与大家分享。稍加改造就可以实现更强大的功能了。
用下面的代码就可以简单的批量导出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文件,放到服务器下访问,就可以看到效果了。