<commit_before>require "app_net/version"
require 'rest_client'
require 'json'

module AppNet
  
end
<commit_msg>Add posts method that pulls and stashed the posts.<commit_after>require "app_net/version"
require 'rest_client'
require 'json'

module AppNet
  def self.posts
    stream = RestClient.get 'https://alpha-api.app.net/stream/0/posts/stream/global'
    json   = JSON.parse stream

    data_stash = []
    json['data'].each do |data|
      user = data['user']['username']
      message = data['text']
      data_stash << "#{user}: #{message}\n"
    end
    data_stash                       
  end
end

{'fraction_non_alphanumeric': 0.12355848434925865, 'fraction_numerical': 0.0016474464579901153, 'mean_word_length': 3.0264900662251657, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '3165206', 'n_tokens_mistral': 196, 'n_tokens_neox': 193, 'n_words': 48}