|
发表于 2023-4-14 15:41:20
|
显示全部楼层
https://52.ht/thread-1157408-1-1.html
很简单啦
这是ruby的脚本,其他语言大概看下就可以开干了,注意运行的ip要跟你netcup访问的ip一样
- require 'http'
- require 'telegram/bot'
- def send_tg(msg)
- title=msg['title'].gsub(/\s/, '')
- url="https://**cup.eu/bestellen/produkt.php?produkt=#{msg['product_id']}&hiddenkey=#{msg['product_key']}"
- message = <<-EOF
- <b>ID:</b> #{msg['id']}
- <b>内容:#{title}</b>
- <b>价格:</b> #{msg['price']}
- <b>购买:</b>#{url}
- EOF
- Telegram::Bot::Client.new("TG的BOT APIKEY").api.send_message(chat_id: "你的ID",
- parse_mode: 'HTML',
- text: message,
- disable_web_page_preview: true)
- end
- headers={
- "accept" => "*/*",
- "cache-control" => "no-cache",
- "cookie" => "替换成COOKIE",
- "referer" => "https://**cup.de/",
- "user-agent" => "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36"
- }
- ids = []
- reqest_urls = %w(
- /
- /hosting/
- /vserver/
- /vserver/vstorage.php
- /vserver/vps.php
- /bestellen/domainangebote.php
- /ssl-zertifikate/
- /bestellen/softwareangebote.php
- /groupware/
- /professional/
- /professional/dedizierte-server/
- /professional/managed-server/
- /professional/colocation/
- /professional/softwareentwicklung/
- /jobs/
- /ueber-netcup/
- /support/
- )
- request_url_index = 0
- while true
- begin
- response = HTTP.headers(headers).post("https://**cup.de/api/eggs", form: {
- "requrl": reqest_urls[request_url_index % reqest_urls.size]
- })
- if response.status.success?
- msg = JSON.parse(response.to_s)['eggs'][0]
- price = msg['price'].gsub('€', '').gsub(',', '.').to_f
- unless ids.include?("#{msg['id']}#{msg['product_key']}")
- send_tg(msg)
- ids.push("#{msg['id']}#{msg['product_key']}")
- end
- end
- rescue => exception
- puts exception.backtrace
- ensure
- request_url_index = request_url_index + 1
- sleep 3
- end
复制代码 |
|