Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9230831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:54:57+00:00 2026-06-18T05:54:57+00:00

The JSON object I’m parsing is at http://api.4chan.org/3/catalog.json Here is my Ruby code: [‘open-uri’,’nokogiri’,’json’].each{|g|

  • 0

The JSON object I’m parsing is at http://api.4chan.org/3/catalog.json

Here is my Ruby code:

['open-uri','nokogiri','json'].each{|g| require g}

json_test = File.open('json_test.JSON','r').read
board_cat_body = Nokogiri::HTML(open('http://api.4chan.org/3/catalog.json'))

puts JSON.parse(board_cat_body)

Result (it’s very long so I took a part of it out):

C:/Ruby193/lib/ruby/1.9.1/json/common.rb:148:in `parse': 387: unexpected token at '{"no":248019,"sticky":1,"closed":1,"now":"12\/19....

However, if I copy and paste the contents of http://api.4chan.org/3/catalog.json into a local JSON file and parse from that local JSON file, there is no problem.

Does anyone know what I’m doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T05:54:58+00:00Added an answer on June 18, 2026 at 5:54 am

    Remove the Nokogiri call. JSON isn’t HTML.

    ['open-uri','json'].each{|g| require g}
    json = JSON.parse(open('http://api.4chan.org/3/catalog.json').read)
    puts json.inspect
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have updated my jSon object using the code <script type=text/javascript > jQuery(document).ready(function($){ var
I am sending JSON object through following code.. Controller returning values in CSV format
here goes the first JSON object to string output { session_id : zzz00001111, name
I am getting a json object from an HTTP stream. I create a JObject
I am sending a JSON object to a HTTP Server by using the following
I am posting a json object to an ASP.Net MVC controller with C# code.
This is the json object: {Packet:{Response:Handshake,Code:lmhn,UID:4e1d137caaed7}} For some reason I am getting a syntax
I have a json object(say dobject) returning data from a json file Here is
I have a JSON object passed into my REST API. I use a generic
I have a JSON object from the CrunchBase API giving me a bunch of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.