权朗网络API3.0

权朗网络API3.0


函数库,必看

<pre><code class="language-lua">//注意,所有的代码都依赖于函数库,首先把函数库复制到代码里,修改下面两个信息 //注意,所有的代码都依赖于函数库,首先把函数库复制到代码里,修改下面两个信息 Function Request(api, 参数) //-------------------------------------------这里是需要修改的参数 API密码 = &amp;quot;xxx&amp;quot;//在后台的设置,或者APP的通用设置里面找 开发者ID = &amp;quot;xxx&amp;quot;//在后台左上角,或者APP【我的】中的【VID】 //-------------------------------------------------------------- Randomize ApiList = array(&amp;quot;https://napi.2cccc.cc/&amp;quot;, &amp;quot;http://api2.2cccc.cc/&amp;quot;, &amp;quot;http://api3.2cccc.cc/&amp;quot;) Host = ApiList(Int((UBound(ApiList) - 0 + 1) * Rnd() + 0)) 时间戳 = timestamp(0) connect_times = 0 签名 = Plugin.Encrypt.Md5String(API密码 &amp;amp; 时间戳) common_params = &amp;quot;center_id=&amp;quot; &amp;amp; 开发者ID &amp;amp; &amp;quot;&amp;amp;tmstamp=&amp;quot; &amp;amp; 时间戳 &amp;amp; &amp;quot;&amp;amp;sign=&amp;quot; &amp;amp; 签名 Res = Lib.网络.获得网页源文件_增强版(Host &amp;amp; api &amp;amp; &amp;quot;?&amp;quot; &amp;amp; common_params &amp;amp; &amp;quot;&amp;amp;&amp;quot; &amp;amp; 参数, &amp;quot;utf-8&amp;quot;) connect_times = 0 Do While Instr(1, Res, &amp;quot;code&amp;quot;, 1) = 0 Rand = Int((UBound(ApiList) - 0 + 1) * Rnd() + 0) Host = ApiList(Int((UBound(ApiList) - 0 + 1) * Rnd() + 0)) Res = Lib.网络.获得网页源文件_增强版(Host &amp;amp; api &amp;amp; &amp;quot;?&amp;quot; &amp;amp; common_params &amp;amp; &amp;quot;&amp;amp;&amp;quot; &amp;amp; 参数, &amp;quot;utf-8&amp;quot;) connect_times = connect_times + 1 If Instr(1, Res, &amp;quot;code&amp;quot;, 1) = 0 and connect_times &amp;gt; 1 Then TracePrint &amp;quot;连接服务器失败,正在尝试重新请求&amp;quot; Delay 2000 End If If connect_times &amp;gt; 30 Then Request = array(0, &amp;quot;无法连接服务器&amp;quot;) Exit Do End If Loop If json_decode(Res, &amp;quot;code&amp;quot;) = 1 Then If UCase(Plugin.Encrypt.Md5String(json_decode(Res, &amp;quot;timestamp&amp;quot;) &amp;amp; API密码)) = Ucase(json_decode(Res, &amp;quot;sign&amp;quot;)) and Abs(clng(时间戳) - clng(json_decode(Res,&amp;quot;timestamp&amp;quot;))) &amp;lt; 600 Then Request = array(1, Res) Else Request = array(0,&amp;quot;请检查API密码是否填写正确&amp;quot;) End If Else msg = json_decode(Res, &amp;quot;msg&amp;quot;) If msg = &amp;quot;&amp;quot; Then msg = &amp;quot;连接服务器失败&amp;quot; End If Request = array(0,msg) End If End Function Function json_decode(str,json路径) Set sc = CreateObject(&amp;quot;MSScriptControl.ScriptControl&amp;quot;) sc.Language = &amp;quot;JScript&amp;quot; sc.AddCode &amp;quot;var tmp = &amp;quot; &amp;amp; str &amp;amp; &amp;quot;;&amp;quot; json_decode = sc.Eval(&amp;quot;tmp.&amp;quot; &amp;amp; json路径) End Function Function timestamp(times) If times = 0 Then 淘宝时间戳JSON = Lib.网络.获得网页源文件_增强版(&amp;quot;http://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp&amp;quot;, &amp;quot;utf-8&amp;quot;) 淘宝时间戳 = json_decode(淘宝时间戳JSON, &amp;quot;data.t&amp;quot;) If 淘宝时间戳 &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then TracePrint &amp;quot;获取淘宝时间戳成功&amp;quot; timestamp = left(淘宝时间戳, 10) Else TracePrint &amp;quot;获取淘宝时间戳失败,开始获取拼多多时间戳&amp;quot; timestamp = timestamp(times + 1) End If End If If times = 1 Then 拼多多时间戳JSON = Lib.网络.获得网页源文件_增强版(&amp;quot;http://api.pinduoduo.com/api/server/_stm&amp;quot;, &amp;quot;utf-8&amp;quot;) 拼多多时间戳 = json_decode(拼多多时间戳JSON, &amp;quot;server_time&amp;quot;) If 拼多多时间戳 &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then TracePrint &amp;quot;获取拼多多时间戳成功&amp;quot; timestamp = left(拼多多时间戳, 10) Else TracePrint &amp;quot;获取拼多多时间戳失败,开始获取世界时间戳&amp;quot; timestamp = timestamp(times + 1) End If End If If times = 2 Then 世界时间戳JSON = Lib.网络.获得网页源文件_增强版(&amp;quot;http://worldtimeapi.org/api/timezone/Asia/Shanghai&amp;quot;, &amp;quot;utf-8&amp;quot;) 世界时间戳 = json_decode(世界时间戳JSON, &amp;quot;unixtime&amp;quot;) If 世界时间戳 &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then TracePrint &amp;quot;获取世界时间戳成功&amp;quot; timestamp = left(世界时间戳, 10) Else TracePrint &amp;quot;获取世界时间戳失败,开始获取本地时间戳&amp;quot; timestamp = timestamp(times + 1) End If End If If times = 3 Then TracePrint &amp;quot;获取本地时间戳&amp;quot; timestamp = DateDiff(&amp;quot;s&amp;quot;, &amp;quot;1970-01-01 00:00:00&amp;quot;, Now) End If End Function</code></pre>

页面列表

ITEM_HTML