wlzboy
2025-08-07 54979feba74bd3c7dea2630e1ba96401b25f60d8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%Session.CodePage=65001%>
<!--#include virtual="/inc/odbc.asp"-->
 
<!docType html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
<title>微信获取素材列表</title>
<!--#include virtual="/inc/JsonPost.asp"-->
</head>
<body>
<center>
 
<%'Response.end
    '微信临时二维码请求
 
for offset=0 to 1
    appUrl="https://api.weixin.qq.com/cgi-bin/material/batchget_material?access_token="&access_token
 
    args1="{"
    'args1=args1&"""type"":""news"","
    args1=args1&"""type"":""image"","
    args1=args1&"""offset"":"&offset*20&","
    args1=args1&"""count"":20"
    args1=args1&"}"
 
'Response.Write appUrl&"<br>"&args1 &"<br><br><br>"
'Response.end
HTMLCODE= PostBody(appUrl,args1)
'Response.Write HTMLCODE &"<br><br>"
json=HTMLCODE
%>
<script language="jscript" runat="server">
Array.prototype.get = function(i)
{
 return this[i]; 
};
function getjson(str){
 try{
  eval("var jsonStr = (" + str + ")");
 }catch(ex){
  var jsonStr = null;
 }
 return jsonStr;
}
</script>
<%
        str=json
        str=right(str,len(str)-instr(str,"?{")+1)
        str=left(str,InstrRev(str,"}"))
        dim obj
        set obj = getjson(str)
        str0=""
        If obj.item.get(0)="[object Object]" Then
        for j=0 to obj.item.length-1
            media_id    = obj.item.get(j).media_id    '    日期
            'title        = obj.item.get(j).content.news_item.get(0).title    '标题
            title    = obj.item.get(j).url    '图片连接
            Response.Write (j+1)+(offset*20)&"<br>"&"media_id:"&media_id &"<br>"&title&"<br><br>"
        Next
    End If
            
Next
 
 
%>
</body>
</html>