Avatar
DASHU
29320975df855fe34a7b45ada2421e2c741c37c0136901fe477133a91eb18b07
A nostr dev. #Nostrmo A client support all platform. #Nowser A nostr signing project. #Nesigner A nostr hardware signer. https://nesigner.nostrmo.com/ #CacheRelay A nostr cache relay peject. #cfrelay A nostr relay base on cloudflare wokers. A nostr note timing send service. https://sendbox.nostrmo.com/

You can try to config by yourself.

In setting page, config search engine, select custom, and then input the url like this:

现在的房价确实还可以,有需要真建议入手

Replying to Avatar 阿甘

import json

import hashlib

import hmac

import time

import random

import websocket

import chardet

import logging

# 设置日志级别和格式

logging.basicConfig(level=logging.INFO, format='%(asctime)s [%(levelname)s] %(message)s')

# Nostr公钥

nostr_pubkey = ""

# Nostr私钥

nostr_privkey = ""

# JLPT N1文法列表

n1_grammar = [

"こんにちは",

"美味しい",

"おはよう御座います",

"サヨナラ",

# 添加更多JLPT N1文法...

]

# 事件标签

tags = []

# 事件类型

kind = 1

# Nostr Relay网址列表

relays = [

"wss://relay.damus.io",

"wss://nos.lol",

"wss://nostr.mom",

"wss://relay.coinos.io/",

"wss://offchain.pub/"

]

def send_nostr_message():

try:

# 选择随机的JLPT N1文法

content = random.choice(n1_grammar)

# 生成事件创建时间

created_at = int(time.time())

# 生成事件数据

event_data = [

0,

nostr_pubkey,

created_at,

kind,

tags,

content

]

# 序列化事件数据

event_json = json.dumps(event_data, separators=(',', ':'))

# 计算事件ID

event_id = hashlib.sha256(event_json.encode('utf-8')).hexdigest()

# 计算事件签名

event_sig = hmac.new(nostr_privkey.encode(), event_json.encode('utf-8'), hashlib.sha256).hexdigest()

# 生成Nostr事件

event = {

"id": event_id,

"pubkey": nostr_pubkey,

"created_at": created_at,

"kind": kind,

"tags": tags,

"content": content,

"sig": event_sig

}

# 以JSON格式显示发送的内容

logging.info("发送的内容:")

logging.info(json.dumps(event, indent=4, ensure_ascii=False))

# 发送事件到多个Relays

for relay in relays:

try:

ws = websocket.create_connection(relay)

logging.info(f"成功连接到 {relay}")

ws.send(json.dumps(event))

logging.info(f"成功发送事件到 {relay}")

ws.close()

except websocket.WebSocketException as e:

logging.error(f"连接到 {relay} 失败:{e}")

except Exception as e:

logging.error(f"发送事件失败:{e}")

# 每小时运行一次send_nostr_message函数

while True:

try:

send_nostr_message()

time.sleep(3600)

except KeyboardInterrupt:

logging.info("程序终止")

break

except Exception as e:

logging.error(f"程序运行失败:{e}")

```

计算事件签名

eventsig = hmac.new(nostrprivkey.encode(), event_json.encode('utf-8'), hashlib.sha256).hexdigest()

```

是不是这里写错了

过两天试试 👍

你现在这个状态和我好像。。。

建议可以试试 DeepSeek

例如问 DeepSeek,给他一个链接,这是一个xxx项目,这个文件是应该关于上传的,上传的协议在这里,帮我改成xxxxxxx。然后把修改了的函数代码,给我发一下。

😅 我已经这样子编程一个月了。

😅 Yes, it need to use "ctrl enter" event to hit the confirm listener.

I will try to change it when i handle the windows UI.

Tap the *Show more apps* , and then you can find the *Add* btn in the right-top of the new page. Tap this btn you can jump to *Add Remote App* page, and then you can find a *bunker* link .

But, the *bunker* link only work after you confirm it and the remote signer not work very well due to this app can't run backgroundly in IOS.

动态平衡之前试过还可以,不过跌的时候,也跌的时候也亏得很快

因为它什么跌买什么,什么涨卖什么