Curl Get / Post命令行脚本

时间:2016-09-26 17:03:57

标签: php curl post get server

晚上好,

我目前处于需要使用VPN才能访问互联网的位置。我找到了一个我非常喜欢的服务器,因为它是免费的,而且延迟对我来说很低。服务器注册页面位于https://www.tcpvpn.com/create-udpvpn-account-server。问题是每隔5天我必须根据其策略重新创建一个帐户来访问服务器。我之前在课堂上使用过卷曲,并且正在尝试使用卷曲,这样我就可以自动创建新帐户。

所以,我执行命令:

curl https://www.tcpvpn.com/create-udpvpn-account-server >> output.txt

这为我提供了以下输出文件:

<!DOCTYPE html>
<html lang="en">
<head>
<meta name="google-site-verification" content="Lg1B1tLlSQ5j5hU0msAnyw5dxaMngUScJBzt2UwS6Tw"/>
<meta name="google-site-verification" content="Kuieqxus41e0tinyQB04icm10gTbH4x1hgkWcV6cRDg"/>
<meta name="msvalidate.01" content="E37DD70D48269B029B682E6C51997991"/>
<meta name="alexaVerifyID" content="_d7toKLPOA4toMKiOgJrg9QLwo0"/>

<script type="text/javascript">
//<![CDATA[
try{if (!window.CloudFlare) {var CloudFlare=[{verbose:0,p:0,byc:0,owlid:"cf",bag2:1,mirage2:0,oracle:0,paths:{cloudflare:"/cdn-cgi/nexp/dok3v=1613a3a185/"},atok:"f1285dc6b240c6d921956394f9443f98",petok:"fc6cb71e1d3370d5423bdad256a7b050cf9a8798-1474908509-1800",zone:"tcpvpn.com",rocket:"0",apps:{"ga_key":{"ua":"UA-65041386-1","ga_bs":"2"}},sha2test:0}];!function(a,b){a=document.createElement("script"),b=document.getElementsByTagName("script")[0],a.async=!0,a.src="//ajax.cloudflare.com/cdn-cgi/nexp/dok3v=0489c402f5/cloudflare.min.js",b.parentNode.insertBefore(a,b)}()}}catch(e){};
//]]>
</script>
<link rel="stylesheet" href="assets/css/site.css">
<link rel="stylesheet" href="assets/css/pygments.css">
<link rel="stylesheet" href="assets/css/font-awesome.css">
<link href="navbar-static-top.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="dist/css/metro-bootstrap.min.css">

<link rel="stylesheet" href="assets/docs.css">
<link href="css/flag-icon.css" rel="stylesheet">
<link href="navbar-static-top.css" rel="stylesheet">
<link rel="shortcut icon" href="foto/tcpvpnfv.png"/>
<link rel="alternate" href="http://tcpvpn.com/" hreflang="x-default"/>
<script src="js/ie-emulation-modes-warning.js"></script>
<script src="js/ie10-viewport-bug-workaround.js"></script>

<meta content='ID Google Webmaster Verfikasi' name='google-site-verification'/>
<meta content='ID Bing Verification' name='msvalidate.01'/>
<meta content='ID Alexa Verification' name='alexaVerifyID'/>
<link rel="profile" href="http://tcpvpn.com/sitemap/sitemap.xml"/>
<script type="text/javascript" src="http://31804627.ranking.fc2.com/analyze.js" charset="utf-8"></script>
<title>Create Free OpenVPN UDP Account | TcpVPN.com</title>
<meta charset='utf-8'/>
<meta content='width=device-width, initial-scale=1, maximum-scale=1' name='viewport'/>
<meta content='http://www.TcpVPN.com' property='og:url'/>
<meta content='Udp Vpn Account' property='og:site_name'/>
<meta content='Server Udp VPN Account' property='og:title'/>
<meta content='website' property='og:type'/>
<meta property='fb:app_id' content='983032945042669'/>
<meta property='fb:admins' content='kzs.oftz'/>
<meta name='description' content='create account vpn '/>
<meta name='keywords' content='create account vpn '/>
<meta name='author' content='TcpVPN.com'/>
<meta name='rating' content='general'/>
<meta name='distribution' content='global'/>
<meta name='copyright' content='TcpVPN.com'/>
<script type="text/javascript">
    if (top.location != self.location) {
      top.location = self.location
    }
    </script>
<script type="text/javascript">
/* <![CDATA[ */
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-65041386-1']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

(function(b){(function(a){"__CF"in b&&"DJS"in b.__CF?b.__CF.DJS.push(a):"addEventListener"in b?b.addEventListener("load",a,!1):b.attachEvent("onload",a)})(function(){"FB"in b&&"Event"in FB&&"subscribe"in FB.Event&&(FB.Event.subscribe("edge.create",function(a){_gaq.push(["_trackSocial","facebook","like",a])}),FB.Event.subscribe("edge.remove",function(a){_gaq.push(["_trackSocial","facebook","unlike",a])}),FB.Event.subscribe("message.send",function(a){_gaq.push(["_trackSocial","facebook","send",a])}));"twttr"in b&&"events"in twttr&&"bind"in twttr.events&&twttr.events.bind("tweet",function(a){if(a){var b;if(a.target&&a.target.nodeName=="IFRAME")a:{if(a=a.target.src){a=a.split("#")[0].match(/[^?=&]+=([^&]*)?/g);b=0;for(var c;c=a[b];++b)if(c.indexOf("url")===0){b=unescape(c.split("=")[1]);break a}}b=void 0}_gaq.push(["_trackSocial","twitter","tweet",b])}})})})(window);
/* ]]> */
</script>
</head>
<style type="text/css">#blockblockA{position:absolute;top:0px;left:0px;background-color:#000000;width:100%;height:100%;}#blockblockA td{text-align:center;width:100%;height:100%;}#blockblockA td p{font:bold 15px Verdana;color:#ffffff;}#blockblockA td div{font:bold 13px Verdana;color:#ffffff;}#blockblockB{visibility:invisible;display:none;}#linkA{font:bold 12px Verdana;color:#ffffff;}</style>
<noscript>
<style type="text/css">#blockblockA{visibility:invisible!important;display:none!important;}#blockblockA td{visibility:invisible!important;display:none!important;}#blockblockA td p{visibility:invisible!important;display:none!important;}#blockblockB{visibility:visible!important;display:block!important;}</style>
</noscript>
<script type="text/javascript" src="ads/advertisement.js"></script>
<table id="blockblockA"><tr><td>
<p>Please Disable Adblock To View This Website</p>
</td></tr></table>
<span id="blockblockB"/> <body>

<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-NHWMX8');</script>

<div class="navbar navbar-default navbar-static-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
MENU
</button>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class=""><a href="https://www.tcpvpn.com/home" title="free vpn server Accounts"> <i class="fa fa-home"></i> Home </a></li>
<li class="dropdown">
<a href="" class="dropdown-toggle" data-toggle="dropdown"> VPN Server <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li class=""><a href="https://www.tcpvpn.com/Free-VPN" title="Free TCP VPN server Accounts">VPN TCP Server</a></li>
<li class=""><a href="https://www.tcpvpn.com/Free-VPN" title="Free UDP VPN server Accounts">VPN UDP Server</a></li>
<li class=""><a href="https://www.tcpvpn.com/vpn-torrenting" title="vpn support torrent">VPN Torrenting</a></li>
<li class=""><a href="https://www.tcpvpn.com/check-vpn-account" title="check vpn account">Check VPN Account</a></li>
<li class=""><a href="https://www.tcpvpn.com/generate-IP-Address-to-IP-Decimal" title="generate ip to decimal">Generate IP to Decimal</a></li>
</ul>
</li>
<li class=""><a href="https://www.tcpvpn.com/free-vpn-sgdo-server" title="free vpn sgdo server">X-SGDO</a></li>
<li class="dropdown">
<a href="" class="dropdown-toggle" data-toggle="dropdown">PPTP<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li class=""><a href="https://www.tcpvpn.com/free-vpn-server-protocol-pptp" title="Free VPN Server Protocol PPTP">PPTP Server</a></li>
<li><a target=\'blank\' href="http://mytunnel.info/openvpn/how-to-connect-pptp-in-tcpvpn-com/" title="how to connect PPTP VPN">How To Connect</a></li>              
              </ul>
        </li>
            <li class=""><a href="https://www.tcpvpn.com/exclusive-server" title="exclusive openvpn">EXC Server</a></li>
            <li class=""><a href="https://www.tcpvpn.com/download-software-open-vpn" title="download software openvpn client android, ios, windows">Download Software</a></li>
            <li class="dropdown">
          <a href="" class="dropdown-toggle" data-toggle="dropdown">Server Config<span class="caret"></span></a>
          <ul class="dropdown-menu" role="menu">
                <li class=""><a href="https://www.tcpvpn.com/tcp-vpn-config" title="openvpn config tcp server">TCP Server</a></li>              
                <li class=""><a href="https://www.tcpvpn.com/udp-vpn-config" title="openvpn config udp server">UDP Server</a></li>
                <li class=""><a href="https://www.tcpvpn.com/tcp-vpn-sgdo-config" title="openvpn config sgdo server">SGDO Server</a></li>
                <li class=""><a href="https://www.tcpvpn.com/tcp-vpn-sggs-config" title="openvpn config sggs server">TCP SGGS Server</a></li>
                <li class=""><a href="https://www.tcpvpn.com/exclusive-vpn-config" title="openvpn config exclusive server">Exclusive Server</a></li>
          </ul>
        </li>           
            <li class=""><a href="https://www.tcpvpn.com/squid-proxy" title="squid proxy">Squid Proxy</a></li>
            <li class=""><a href="https://www.tcpvpn.com/dns-records" title="dns server and generate config">DNS</a></li>
            <li class=""><a href="https://www.tcpvpn.com/request-and-report" title="request and report tcpvpn.com">Report</a></li>
            <li class=""><a href="https://www.tcpvpn.com/terms-of-service" title="terms of service">TOS</a></li>            

            <li class="dropdown">
          <a href="" class="dropdown-toggle" data-toggle="dropdown">Follow Us <span class="caret"></span></a>
          <ul class="dropdown-menu" role="menu">

            <li><a target=\'blank\' href='https://www.facebook.com/pages/Tcpvpn/983032945042669' title='fanpage tcpvpn.com'><i class='fa fa-facebook'></i> FB Fan Page</a></li>
                <li><a target=\'blank\' href='https://www.facebook.com/groups/540972616005468/' title='fb groub tcpvpn.com'><i class='fa fa-users'></i> FB Group</a></li>
            <li><a target=\'blank\' href='https://twitter.com/tcp_vpn' title='twitter tcpvpn.com'><i class='fa fa-twitter'></i> Twitter</a></li>              </ul>
        </li>
      </ul>
          </div>
      </div>
    </div>




        <div class="header">
    <div class="panel panel-default">
  <div class="panel-body">
   <div class="container">
    <div class="row">

                <div class="col-md-2"> 
                <div class="lgtcp">
                <img src='foto/tcpvpn.png' width='150px;' alt='logo-tcpvpn.com' title='logo tcpvpn.com'>                </div>
                </div>
                <div class="hdinfo">
                <span class="label label-success"><i class="fa fa-wifi"></i> IP Active : 139.59.144.231 </span>


                <span class="label label-success"><i class="fa fa-calendar"></i> Server Time : 23:48:28 26/09/2016  </span>


                <span class="label label-success"><i class="fa fa-history"></i>  Reset : 00:01 ( GMT+7) </span>


                <span class='label label-success'><a href='https://www.tcpvpn.com/login-point' title='login fitur point in tcpvpn.com'><i class='fa fa-angle-double-down'></i> Fitur Point (Account 1 Month)</a></span>                 
            </div>      
        </div>
        </div>
  </div>
</div>
</div>
<div class="container">
<div class="openvpnbody">
<br>
<br>
<br>
<br>
<meta http-equiv='refresh' content='0;url=index.php'>

我试过阅读cURL手册来弄清楚我正在寻找什么来发送正确的命令。我想我可以使用POST或GET,但我不确定过去在这段代码中我应该知道要说什么命令。在本手册的示例中,它在代码中显示了POST和GET,但是我的代码在任何地方都没有。 Stackoverflow建议使用PHP标记,但我不熟悉PHP是什么,不知道是否属于这一类。如果没有,有没有一种方法可以使用它来做我想问的可能更容易?非常感谢本部分的任何指导。

0 个答案:

没有答案