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 6569315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:36:41+00:00 2026-05-25T14:36:41+00:00

I am trying to port this bit of Python code to Java http://www.bemasher.net/archives/1002 (scroll

  • 0

I am trying to port this bit of Python code to Java http://www.bemasher.net/archives/1002 (scroll down to the bottom for the code)

But because everything is dynamically typed, I’m having difficulty porting this. I need to be able to use a Java implementation of Pythons json. Right now I’m using gson ( http://code.google.com/p/google-gson/ ), but I’m open to anything.

Neither of gson’s fromJson’s signatures

public <T> T fromJson(String json, Class<T> classOfT) throws JsonParseException
public <T> T fromJson(String json, Type typeOfT) throws JsonSyntaxException 

match Pythons

data = json.loads(response)

This is the JSON that I am trying to read: http://www.ows.newegg.com/Stores.egg/Categories/1

How would I go about getting the class or type of the JSON above and read through it? All the other examples I’ve seen you have to know what it is.

Thanks!

  • 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-05-25T14:36:42+00:00Added an answer on May 25, 2026 at 2:36 pm

    It basically fetches http://www.ows.newegg.com/Stores.egg/Menus and dumps its contents to a string (response), then it parses the JSON using json.loads() and puts that into data.

    Then it will iterate through the contents of data and build a HTML list using lxml. The list itself should look like:

    <ul>
      <li><a href="/Store?{StoreID}">{StoreTitle}</a></li>
      ...
    </ul>
    

    Where {StoreID} and {StoreTitle} are the IDs and titles fetched and parsed from that URL.

    References: urllib2, json, lxml

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to port this function to c# http://www.phpsnaps.com/snaps/view/clean-url/ I have problems to transform
I am trying to port this algorithm to clojure. My code is (defn calc-iterations
I'm trying to port a Swing application to GWT. However lots of this application
Hey, I'm really struggling with this one. I'am trying to port a small piece
I'm trying to implement something like this: <div> <table> <thead> <tr> <td>Port name</td> <td>Current
i'm trying to port some Java stuff to C#. I'm just wondering if the
I'm currently trying to port an app from asp.net to php, however I just
So I am trying to port 32 bit to 64 bit. I have turned
I'm trying to figure out some C code so that I can port it
Sorry that the question of this problem might be a bit vague. I'm trying

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.