<commit_before>require 'spec_helper'
require 'hactor'
require 'hactor/actor'

class UserListActor
  include Hactor::Actor

  def on_200(response)
    user_links = response.body.links.select { |link| link.rel == 'ht:user' }
    user_links.each do |link|
      puts "#{link.title} (#{link.href})"
    end
  end
end

class LatestPostActor
  include Hactor::Actor

  def on_200(response)
    puts response.body.embedded_resources.all.first.links.all
  end
end

class HomeActor
  include Hactor::Actor

  def on_200(response)<commit_msg>output user count in integration test<commit_after>require 'spec_helper'
require 'hactor'
require 'hactor/actor'

class UserListActor
  include Hactor::Actor

  def on_200(response)
    user_links = response.body.links.select { |link| link.rel == 'ht:user' }
    puts "There's #{user_links.count} users on haltalk:"
    user_links.each do |link|
      puts "#{link.title} (#{link.href})"
    end
  end
end

class LatestPostActor
  include Hactor::Actor

  def on_200(response)
    puts response.body.embedded_resources.all.first.links.all
  end
end

class HomeActor
  include Hactor::Actor

  def on_200(response)
{'fraction_non_alphanumeric': 0.10655021834061135, 'fraction_numerical': 0.01572052401746725, 'mean_word_length': 4.139013452914798, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '6301673', 'n_tokens_mistral': 403, 'n_tokens_neox': 385, 'n_words': 94}