<commit_before>require 'rubygems'
require 'bundler/setup'
require 'nokogiri'
require 'open-uri'
require 'yaml/store'
require 'slack-notifier'

NGAYVANG_URL = 'https://www.vietnamairlines.com/vi/sale-campaign#5ngayvang'.freeze
WEBHOOK_URL = ENV['WEBHOOK_URL']

def slack_notifier(msg)
  notifier = Slack::Notifier.new WEBHOOK_URL, username: 'vnairline'
  notifier.ping msg
end

doc = Nokogiri::HTML(open(NGAYVANG_URL))

info = doc.css('#5ngayvang #fivedays_table p').text
store = YAML::Store.new 'info.yml'

store.transaction do
  unless info == store['info']
    slack_notifier("5ngayvang has been updated! Check it out #{NGAYVANG_URL}")
    store['info'] = info<commit_msg>Also output to terminal when it changes<commit_after>require 'rubygems'
require 'bundler/setup'
require 'nokogiri'
require 'open-uri'
require 'yaml/store'
require 'slack-notifier'

NGAYVANG_URL = 'https://www.vietnamairlines.com/vi/sale-campaign#5ngayvang'.freeze
WEBHOOK_URL = ENV['WEBHOOK_URL']

def slack_notifier(msg)
  notifier = Slack::Notifier.new WEBHOOK_URL, username: 'vnairline'
  notifier.ping msg
end

doc = Nokogiri::HTML(open(NGAYVANG_URL))

info = doc.css('#5ngayvang #fivedays_table p').text
store = YAML::Store.new 'info.yml'

store.transaction do
  unless info == store['info']
    msg = "5ngayvang has been updated! Check it out #{NGAYVANG_URL}"
    puts msg
    slack_notifier msg
    store['info'] = info
{'fraction_non_alphanumeric': 0.12928571428571428, 'fraction_numerical': 0.004285714285714286, 'mean_word_length': 5.639810426540285, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, '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': '3235986', 'n_tokens_mistral': 547, 'n_tokens_neox': 535, 'n_words': 110}