mirror of
				https://github.com/Mabbs/mabbs.github.io
				synced 2025-11-03 23:32:49 +00:00 
			
		
		
		
	Update file post.html
This commit is contained in:
		@@ -40,31 +40,34 @@ layout: default
 | 
			
		||||
      .join(""); // convert bytes to hex string
 | 
			
		||||
    return hashHex;
 | 
			
		||||
  }
 | 
			
		||||
  var postContent = "文章标题:" + {{ page.title | jsonify }} +",文章内容:" + {{ page.content | strip_html | strip_newlines | jsonify }};
 | 
			
		||||
  var postContentSign = await sha(postContent);
 | 
			
		||||
  var outputContainer = document.getElementById("ai-output");
 | 
			
		||||
  $.get("https://summary.mayx.eu.org/is_uploaded?id={{ page.url }}&sign=" + postContentSign, function (data) {
 | 
			
		||||
    if (data == "yes") {
 | 
			
		||||
      $.get("https://summary.mayx.eu.org/get_summary?id={{ page.url }}&sign=" + postContentSign, function (data2) {
 | 
			
		||||
        outputContainer.textContent = data2;
 | 
			
		||||
      });
 | 
			
		||||
    } else {
 | 
			
		||||
      $.post("https://summary.mayx.eu.org/upload_blog?id={{ page.url }}", postContent, function (data) {
 | 
			
		||||
        $.get("https://summary.mayx.eu.org/get_summary?id={{ page.url }}&sign=" + postContentSign);
 | 
			
		||||
        const evSource = new EventSource("https://summary.mayx.eu.org/summary?id={{ page.url }}");
 | 
			
		||||
        outputContainer.textContent = "";
 | 
			
		||||
        evSource.onmessage = (event) => {
 | 
			
		||||
          if (event.data == "[DONE]") {
 | 
			
		||||
            evSource.close();
 | 
			
		||||
            return;
 | 
			
		||||
          } else {
 | 
			
		||||
            const data = JSON.parse(event.data);
 | 
			
		||||
            outputContainer.textContent += data.response;
 | 
			
		||||
  async function ai_gen(){
 | 
			
		||||
    var postContent = "文章标题:" + {{ page.title | jsonify }} + ";文章内容:" + {{ page.content | strip_html | strip_newlines | jsonify }};
 | 
			
		||||
    var postContentSign = await sha(postContent);
 | 
			
		||||
    var outputContainer = document.getElementById("ai-output");
 | 
			
		||||
    $.get("https://summary.mayx.eu.org/is_uploaded?id={{ page.url }}&sign=" + postContentSign, function (data) {
 | 
			
		||||
      if (data == "yes") {
 | 
			
		||||
        $.get("https://summary.mayx.eu.org/get_summary?id={{ page.url }}&sign=" + postContentSign, function (data2) {
 | 
			
		||||
          outputContainer.textContent = data2;
 | 
			
		||||
        });
 | 
			
		||||
      } else {
 | 
			
		||||
        $.post("https://summary.mayx.eu.org/upload_blog?id={{ page.url }}", postContent, function (data) {
 | 
			
		||||
          $.get("https://summary.mayx.eu.org/get_summary?id={{ page.url }}&sign=" + postContentSign);
 | 
			
		||||
          const evSource = new EventSource("https://summary.mayx.eu.org/summary?id={{ page.url }}");
 | 
			
		||||
          outputContainer.textContent = "";
 | 
			
		||||
          evSource.onmessage = (event) => {
 | 
			
		||||
            if (event.data == "[DONE]") {
 | 
			
		||||
              evSource.close();
 | 
			
		||||
              return;
 | 
			
		||||
            } else {
 | 
			
		||||
              const data = JSON.parse(event.data);
 | 
			
		||||
              outputContainer.textContent += data.response;
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
    }
 | 
			
		||||
  });
 | 
			
		||||
        });
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
  ai_gen();
 | 
			
		||||
</script>
 | 
			
		||||
<hr />
 | 
			
		||||
<!-- <![endif]-->
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user