call nostalk

    @@ -8,7 +8,7 @@ (async () => { const ifghost = 'ノス民,none'; - const message = '\\0\_q\オアーッ!!/\\e'; + const message = '\\0\\_q\オアーッ!!/\\e'; const sspServerURL = 'http://localhost:9801'; const callNostalk = async () => { const mes = [
  • /*
     * @title call nostalk
     * @description nostalkに喋らせる
     * @include https://*
     * @license CC0 1.0
     * @require
     */
    
    (async () => {
      const ifghost = 'ノス民,none';
      const message = '\\0\\_q\オアーッ!!/\\e';
      const sspServerURL = 'http://localhost:9801';
      const callNostalk = async () => {
        const mes = [
          'NOTIFY SSTP/1.1',
          'Charset: UTF-8',
          'Sender: SSTP-bookmarklet',
          'SecurityLevel: external',
          'Event: OnNostrCallNostalk',
          'Option: nobreak',
          `IfGhost: ${ifghost}`,
          `Script: ${message}`,
          '',
          ''
        ].join('\n');
        const res = await postData(sspServerURL + '/api/sstp/v1', mes);
        console.log(mes, '----------\n', res, '----------\n');
      };
      const postData = async (url = '', data = '') => {
        const param = {
          method: 'POST',
          headers: {
            'Content-Type': 'text/plain',
            Origin: sspServerURL
          },
          body: data
        };
        try {
          const response = await fetch(url, param);
          return response.text();
        } catch (error) {
          console.log(error);
          return '';
        }
      };
      callNostalk();
    })();
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2025/03/31 12:38:11 - 03/31
  2. 2025/03/31 12:37:42 - 03/31