<commit_before># Find pizza in New York using Google Local

if phantom.state.length is 0
    phantom.state = 'pizza'
    phantom.open 'http://www.google.com/m/local?site=local&q=pizza+in+new+york'
else
    list = document.querySelectorAll 'div.bf'
    for item in list
        console.log item.innerText
    phantom.exit()<commit_msg>Use WebPage in pizza.coffee example.<commit_after># Find pizza in New York using Google Local

page = new WebPage()

page.open 'http://www.google.com/m/local?site=local&q=pizza+in+new+york',
  (status) ->
    if status isnt 'success'
      console.log 'Unable to access network'
    else
      results = page.evaluate ->
        pizza = []
        list = document.querySelectorAll 'div.bf'
        for item in list
          pizza.push(item.innerText)
        return pizza
      console.log results.join('\n')
    phantom.exit()
{'fraction_non_alphanumeric': 0.1148491879350348, 'fraction_numerical': 0.001160092807424594, 'mean_word_length': 2.8873873873873874, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, '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': '3354698', 'n_tokens_mistral': 281, 'n_tokens_neox': 272, 'n_words': 72}