<commit_before># This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
#   cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
#   Mayor.create(name: 'Emanuel', city: cities.first)
@ebevents = Unirest.get("https://www.eventbriteapi.com/v3/categories?&short_name&token=<KEY>").body['categories'].each { |e| puts e.values[2] }
# Eventbrite = GET /categories/¶

# Chiketto::Category.list

categories['categories'].map { |cat| Chiketto::Category.new cat }
{"resource_uri"=>"https://www.eventbriteapi.com/v3/categories/103/", "id"=>"103", 
"name"=>"Music", "name_localized"=>"Music", "short_name"=>"Music", "short_name_localized"=>"Music"}, 
{"resource_uri"=>"https://www.eventbriteapi.com/v3/categories/101/", "id"=>"101", "name"=>"Business & Professional", 
"name_localized"=>"Business & Professional", "short_name"=>"Business", "short_name_localized"=>"Business"}

event = Chiketto::Event.find '22592779612'
@events = Eventbrite::Event.search({q: 'dinosaurs'}, 'FHO43SJ3VXJC6S3P2TRR').events[0..3]
# Next task is to seed my model <commit_msg>Seeding strategy<commit_after># This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
#   cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
#   Mayor.create(name: 'Emanuel', city: cities.first)
# There are three gems in the folling examples, unirest does the direct url get. Its clearer as it can read in the path. Searching events by attributes and 
# not just by keyword as seen in the Eventbrite.search gem/wrapper. Additionally the third Chicketto search returns error.
# there is some benifit to the wrappers though like accessing key val faster. 

me = Unirest.get("https://www.eventbriteapi.com/v3/events/search/?venue.city=chicago&token=<KEY>")
be = Unirest.get("https://www.eventbriteapi.com/v3/events/search/?category=103&token=<KEY>").body.first
me.body.values.last.first.keys
=> ["name", "description", "id", "url", "start", "end", "created", "changed", "capacity", "status", "currency", "listed", "shareable", "online_event", "tx_time_limit", "hide_start_date", "locale", "is_locked", "privacy_setting", "is_series", "is_series_parent", "is_reserved_seating", "logo_id", "organizer_id", "venue_id", "category_id", "subcategory_id", "format_id", "resource_uri", "logo"]
chievents = Unirest.get("https://www.eventbriteapi.com/v3/events/search/?venue.city=chicago&token=<KEY>")
user = Unirest.get("https://www.eventbriteapi.com/v3/users/me/?token=<KEY>")



# Chiketto::Category.list

categories['categories'].map { |cat| Chiketto::Category.new cat }
{"resource_uri"=>"https://www.eventbriteapi.com/v3/categories/103/", "id"=>"103", 
"name"=>"Music", "name_localized"=>"Music", "short_name"=>"Music", "short_name_localized"=>"Music"}, 
{"resource_uri"=>"https://www.eventbriteapi.com/v3/categories/101/", "id"=>"101", "name"=>"Business & Professional", 
"name_localized"=>"Business & Professional", "short_name"=>"Business", "short_name_localized"=>"Business"}

kevent = Chiketto::Event.find '22592779612'#this find works



devents = Eventbrite::Event.search({q: '22592779612'}, 'FHO43SJ3VXJC6S3P2TRR').events[0..3]
# Next task is to seed my event model 
{'fraction_non_alphanumeric': 0.17885004334007512, 'fraction_numerical': 0.02484830973707021, 'mean_word_length': 6.413276231263383, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 33, 'https://': 9, 'lorem ipsum': 0, 'www.': 9, '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': '3541084', 'n_tokens_mistral': 1250, 'n_tokens_neox': 1185, 'n_words': 267}