Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Script that fetches and tweets the current balance of #petya ransomware bitcoin wallet
# Copyright Loran Kloeze
# License: MIT
# 27-06-2017
require 'nokogiri'
require 'open-uri'
require 'twitter'
require 'json'
while true do
btc = JSON.parse(open("").read)
stock_price = btc['d'].last.to_f
client = do |config|
config.consumer_key = "XXXXXXXXXXXXXXXXX"
config.consumer_secret = "XXXXXXXXXXXXXXXXX"
config.access_token = "XXXXXXXXXXXXXXXXX"
config.access_token_secret = "XXXXXXXXXXXXXXXXX"
doc = Nokogiri::HTML(open(""))
total_received = doc.css('#total_received > font > span')[0].text
final_balance = doc.css('#final_balance > font > span')[0].text
total_dollars = (total_received.to_f * stock_price).to_i.to_s
date ="%d/%m %H:%M CEST")
tweet = "#{date}: The new #goldeneye/#petya ransomware bitcoinwallet has received a total amount of #{total_received}, that's +/- $ #{total_dollars}"
print "Sending #{tweet}\n"
sleep 600
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.