來與大家分享。稍加改造就可以實(shí)現(xiàn)更強(qiáng)大的功能了。
用下面的代碼就可以簡(jiǎn)單的批量導(dǎo)出picasa相冊(cè)的外鏈了。
復(fù)制代碼 代碼如下:
%@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=lh2continue=http://picasaweb.google.com/lh/login?continue=http%3A%2F%
2Fpicasaweb.google.com%2Fhomeltmpl=gph1=zh_CNGALX=ip37cq7CgwEEmail="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;ialbums.length;i++)
html+="li>a href='http://%=Request.ServerVariables("Server_Name")Request.ServerVariables("SCRIPT_NAME")%>?type=photourl="+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;iphotoes.length;i++)
html+="li>"+photoes[i]["content$src"]+"/li>";
html+="/ul>";
document.body.innerHTML=html;
}
// -->/script>
%
end if
%>
%=xmlget%>
將上面的代碼里picasa的用戶名密碼改好,保存成ASP文件,放到服務(wù)器下訪問,就可以看到效果了。
您可能感興趣的文章:- JS 相冊(cè)效果 自動(dòng)播放[本地整合]
- javascript dom代碼應(yīng)用 簡(jiǎn)單的相冊(cè)[firefox only]
- 收集的10個(gè)免費(fèi)的jQuery相冊(cè)
- 23個(gè)超流行的jQuery相冊(cè)插件整理分享
- javascript橢圓旋轉(zhuǎn)相冊(cè)實(shí)現(xiàn)代碼
- jQuery 網(wǎng)易相冊(cè)鼠標(biāo)移動(dòng)顯示隱藏效果實(shí)現(xiàn)代碼
- js相冊(cè)效果代碼(點(diǎn)擊創(chuàng)建即可)
- 基于spring+hibernate+JQuery開發(fā)之電子相冊(cè)(附源碼下載)
- 原生js實(shí)現(xiàn)移動(dòng)開發(fā)輪播圖、相冊(cè)滑動(dòng)特效
- 非常漂亮的相冊(cè)集 使用jquery制作相冊(cè)集