ASP JavaScript Picasa batch export of album outer links

Source: Internet
Author: User
Tags servervariables

To share with you. A little transformation can achieve more powerful functions.
Use the following Code You can export the external links of the Picasa album in batches. Copy code The Code is as follows: <% @ Language = "VBScript" codePage = "65001" %>
<%
Dim xmlget, XMLHTTP, email, paswd
Email = "youremail" 'enter the Picasa account email
Paswd = "yourpassword" 'enter the password of 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 % 2 fhome & 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
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
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
%>

[I]. URL) + "'>" + albums [I]. title + "</a> </LI> <br/> ";
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 %>

Change the username and password of Picasa in the above Code, save it as an ASP file, and put it under the server for access. Then you can see the effect.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.