<commit_before>Dir[File.join(File.dirname(__FILE__), 'adapters', '*.rb')].each { |file| require file }
require File.join(File.dirname(__FILE__), 'hash_cache')
require File.join(File.dirname(__FILE__), 'utils')
require 'faraday'
require 'sinatra'
require 'geocoder'
require 'json'

Geocoder.configure({
  :always_raise => [Geocoder::OverQueryLimitError],
})

get '/' do
	content_type :html
	response = '<a href="'+request.url+'tree-planting">' + request.url + 'tree-planting</a><br/>'
	response << '<a href="'+request.url+'tow-away-zones">' + request.url + 'tow-away-zones</a><br />'
  response << '<a href="'+request.url+'street-use-permits">' + request.url + 'street-use-permits</a><br />'
  response << '<a href="'+request.url+'food-truck-permits">' + request.url + 'food-truck-permits</a><br />'
end

get '/tree-planting' do
  url = URI('http://data.sfgov.org/resource/tkzw-k3nq.json')
  url.query = Faraday::Utils.build_query(
    '$order' => 'plantdate DESC',
    '$limit' => 100,
    '$where' => "treeid IS NOT NULL"+
    " AND permitnotes IS NOT NULL"+
    " AND latitude IS NOT NULL"+<commit_msg>Simplified the index page logic<commit_after>Dir[File.join(File.dirname(__FILE__), 'adapters', '*.rb')].each { |file| require file }
require File.join(File.dirname(__FILE__), 'hash_cache')
require File.join(File.dirname(__FILE__), 'utils')
require 'faraday'
require 'sinatra'
require 'geocoder'
require 'json'

Geocoder.configure({
  :always_raise => [Geocoder::OverQueryLimitError],
})

get '/' do
  endpoints = %w[tree-planting tow-away-zones street-use-permits food-truck-permits new-business-locations]
	content_type :html
  endpoints.collect{ |ep| "<a href='#{request.url}#{ep}'>#{request.url}#{ep}</a>" }.join("<br />")
end

get '/tree-planting' do
  url = URI('http://data.sfgov.org/resource/tkzw-k3nq.json')
  url.query = Faraday::Utils.build_query(
    '$order' => 'plantdate DESC',
    '$limit' => 100,
    '$where' => "treeid IS NOT NULL"+
    " AND permitnotes IS NOT NULL"+
    " AND latitude IS NOT NULL"+
{'fraction_non_alphanumeric': 0.19822046465645082, 'fraction_numerical': 0.003954522985664854, 'mean_word_length': 4.883720930232558, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 26, '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': '2579234', 'n_tokens_mistral': 743, 'n_tokens_neox': 729, 'n_words': 144}