I wanted to make a photo album in my own space, so I searched around and used picasa. The function is very convenient. The only drawback is that it is too troublesome to obtain external links. It is too hard to copy and paste one by one, so I wrote a simple one using asp+javascript. program to share with you. With a little modification, more powerful functions can be achieved.
Use the following code to simply export the external links of the picasa album in batches.
Copy the code code as follows:
<%@LANGUAGE=VBSCRIPT CODEPAGE=65001%>
<%
dim xmlget,xmlhttp,email,paswd
email=youremail 'Enter picasa's account email
paswd=yourpassword 'Enter picasa password
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<mpl=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 photos = arguments[6].feedPreload.feed.entry;
for (var i=0;i<photoes.length;i++)
html+=<li>+photos[i][content$src]+</li>;
html+=</ul>;
document.body.innerHTML=html;
}
// --></script>
<%
end if
%>
<%=xmlget%>
Change the picasa username and password in the above code, save it as an ASP file, access it on the server, and you can see the effect.