<commit_before>import requests
import json
import os.path

from watcher.watcher import Watcher

class TweakersWatcher(Watcher):
    watcher_name = 'Tweakers Pricewatch'
    filename = 'site_tweakers.txt'

    def parse_site(self):
        url = 'https://tweakers.net/xmlhttp/xmlHttp.php?application=tweakbase&type=filter&action=deals&dayOffset=1&minRelativePriceDrop=0.4&maxRelativePriceDrop=1&minAbsolutePriceDrop=30&maxAbsolutePriceDrop=&minCurrentPrice=0&maxCurrentPrice=&minPrices=3&minViews=0&of=absolutePriceDrop&od=desc&output=json'
        request = requests.get(url)
        json_object = json.loads(request.text)
        return json_object['data']['html']


    def check_price_error(self):
        url = 'https://tweakers.net/pricewatch/deals/#filter:q1ZKSaz0T0srTi1RsjLUUcpNrAhKzUksySxLDSjKTE51KcovgEhk5jkmFefnlJYgSxgZgGWcS4uKUvNKwBJKVhAxMKcYpheLoQZ6ZmCpsMzUcqA6g1oA'
        message_text = 'Mogelijke prijsfout, check: {0}'.format(url)
        html = self.parse_site()

        if not os.path.isfile(self.filename):
            self.write_to_file(self.filename, html)
            exit(0)
        else:
            with open(self.filename, 'r') as f:
                file_content = f.read()
                if file_content != html:
                    self.send_telegram(self.watcher_name, message_text)
            self.write_to_file(self.filename, html)<commit_msg>tweakerswatcher: fix url to match filter<commit_after>import requests
import json
import os.path

from watcher.watcher import Watcher

class TweakersWatcher(Watcher):
    watcher_name = 'Tweakers Pricewatch'
    filename = 'site_tweakers.txt'

    def parse_site(self):
        url = 'https://tweakers.net/xmlhttp/xmlHttp.php?application=tweakbase&type=filter&action=deals&dayOffset=1&minRelativePriceDrop=0.4&maxRelativePriceDrop=1&minAbsolutePriceDrop=30&maxAbsolutePriceDrop=&minCurrentPrice=0&maxCurrentPrice=&minPrices=3&minViews=0&of=absolutePriceDrop&od=desc&output=json'
        request = requests.get(url)
        json_object = json.loads(request.text)
        return json_object['data']['html']


    def check_price_error(self):
        url = 'https://tweakers.net/pricewatch/deals/#filter:q1ZKSaz0T0srTi1RsjLUUcpNrAhKzUksySxLDSjKTE51KcovgEhk5jkmFefnlJYgSxgbgGWcS4uKUvNKwBJKVhAxMKcYqATMw2KogZ4JWCosM7W8GKwrvygltcgtMzUnRclKKRHDtloA'
        message_text = 'Mogelijke prijsfout, check: {0}'.format(url)
        html = self.parse_site()

        if not os.path.isfile(self.filename):
            self.write_to_file(self.filename, html)
            exit(0)
        else:
            with open(self.filename, 'r') as f:
                file_content = f.read()
                if file_content != html:
                    self.send_telegram(self.watcher_name, message_text)
            self.write_to_file(self.filename, html)
{'fraction_non_alphanumeric': 0.10217159131363475, 'fraction_numerical': 0.016019935920256318, 'mean_word_length': 3.7306397306397305, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '211706', 'n_tokens_mistral': 1032, 'n_tokens_neox': 994, 'n_words': 122}