plamoni / SiriProxy

A (tampering) proxy server for Apple's Siri
GNU General Public License v3.0
2.12k stars 343 forks source link

JSON parse issues #539

Closed chickenxcouncil closed 11 years ago

chickenxcouncil commented 11 years ago

listen_for /get me/i do page = HTTParty.get("https://api.4chan.org/b/0.json").body threads = JSON.parse(page) count = 0

    unless threads.nil?
        threads['threads'].each do
          count = count + 1
        end
    end

    if count > 0
        say "You have #{count} new threads."
         unless threads['posts'].nil?
          threads['posts'].each do |x|
            say x['com']
          end
         end
    end

    if count == 0
        say "You have no new threads."
    end

    request_completed

end

for some reason it says that posts is nil but threads never is....I am not sure whats wrong and its doing the same thing for me on the facebook plugin but that worked yesterday and now nothing. Am I doing something wrong?

elvisimprsntr commented 11 years ago

This is a repo is for SiriProxy issues only. Not a repo for how to program in Ruby. I suggest you post your question on stackoverflow