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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:46:36+00:00 2026-06-11T18:46:36+00:00

Maybe I am repeating this question but I am trying this out for the

  • 0

Maybe I am repeating this question but I am trying this out for the first time and I can’t find anything exactly like my situation..

I am coding in C# and using JSON.NET to deserialize a json. The json file is coming from twitter as a response to this GET request:
https://api.twitter.com/1/statuses/home_timeline.json?include_entities=true

The json is a list of 20 latest tweets (json objects) from a given user’s twitter timeline and the format of a single json object is like this:

{
"created_at": "Thu Sep 20 10:25:39 +0000 2012",
"id": 248729631476314100,
"id_str": "248729631476314112",
"text": "Ask the experts and learn what's new with v.2.2 at  at #MongoDBPune (http://t.co/o5BA7zd6) and #MongoDBBangalore (http://t.co/7q3E2MBq)",
"source": "<a href=\"http://www.socialrithmic.com\" rel=\"nofollow\">Socialrithmic</a>",
"truncated": false,
"in_reply_to_status_id": null,
"in_reply_to_status_id_str": null,
"in_reply_to_user_id": null,
"in_reply_to_user_id_str": null,
"in_reply_to_screen_name": null,
"user": {
  "id": 18080585,
  "id_str": "18080585",
  "name": "mongodb",
  "screen_name": "MongoDB",
  "location": "",
  "url": "http://mongodb.org/",
  "description": "High-performance, open source, schema-free document-oriented  database   | www.facebook.com/MongoDB",
  "protected": false,
  "followers_count": 24999,
  "friends_count": 16,
  "listed_count": 1582,
  "created_at": "Fri Dec 12 17:21:18 +0000 2008",
  "favourites_count": 6,
  "utc_offset": -18000,
  "time_zone": "Eastern Time (US & Canada)",
  "geo_enabled": true,
  "verified": false,
  "statuses_count": 1669,
  "lang": "en",
  "contributors_enabled": false,
  "is_translator": false,
  "profile_background_color": "529747",
  "profile_background_image_url": "http://a0.twimg.com/profile_background_images/619655093/767dji3m3k684nza7w9z.png",
  "profile_background_image_url_https": "https://si0.twimg.com/profile_background_images/619655093/767dji3m3k684nza7w9z.png",
  "profile_background_tile": false,
  "profile_image_url": "http://a0.twimg.com/profile_images/2452709870/wo2h8r0qy8d5lsxe5lgd_normal.png",
  "profile_image_url_https": "https://si0.twimg.com/profile_images/2452709870/wo2h8r0qy8d5lsxe5lgd_normal.png",
  "profile_link_color": "43B02A",
  "profile_sidebar_border_color": "829D5E",
  "profile_sidebar_fill_color": "99CC33",
  "profile_text_color": "3E4415",
  "profile_use_background_image": true,
  "default_profile": false,
  "default_profile_image": false,
  "following": true,
  "follow_request_sent": null,
  "notifications": null
},
"geo": null,
"coordinates": null,
"place": null,
"contributors": null,
"retweet_count": 1,
"entities": {
  "hashtags": [
    {
      "text": "MongoDBPune",
      "indices": [
        55,
        67
      ]
    },
    {
      "text": "MongoDBBangalore",
      "indices": [
        95,
        112
      ]
    }
  ],
  "urls": [
    {
      "url": "http://t.co/o5BA7zd6",
      "expanded_url": "http://soc.ai/ZV",
      "display_url": "soc.ai/ZV",
      "indices": [
        69,
        89
      ]
    },
    {
      "url": "http://t.co/7q3E2MBq",
      "expanded_url": "http://soc.ai/ZW",
      "display_url": "soc.ai/ZW",
      "indices": [
        114,
        134
      ]
    }
  ],
  "user_mentions": []
},
"favorited": false,
"retweeted": false,
"possibly_sensitive": false

}

I use this code to get the (deserialized) list:

List<JsonObject> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<JsonObject>>(response);

where ‘response’ holds my json.When I inserted a breakpoint and observed the json objects inside ‘list’, I found this:

{
“created_at”: “Thu Sep 20 10:25:39 +0000 2012”,
“id”: 248729631476314100,
“id_str”: “248729631476314112”,
“text”: “Ask the experts and learn what’s new with v.2.2 at at #MongoDBPune (http://t.co/o5BA7zd6) and #MongoDBBangalore (http://t.co/7q3E2MBq)”,
“source”: “Socialrithmic”,
“truncated”: false,
“in_reply_to_status_id”: null,
“in_reply_to_status_id_str”: null,
“in_reply_to_user_id”: null,
“in_reply_to_user_id_str”: null,
“in_reply_to_screen_name”: null,
“user”: [
[
[]
],
[
[]
],
[
[]
],
[
[]
],
[
[]
],
[
[]
],
[
[]
],
[
[]
],
[
[]
],
[
[]
],
[
[]
],
[
[]
],
[
[]
],
[
[]
],
[
[]
],
[
[]
],
[
[]
],
[
[]
],
[
[]
],
[
[]
],
[
[]
],
[
[]
],
[
[]
],
[
[]
],
[
[]
],
[
[]
],
[
[]
],
[
[]
],
[
[]
],
[
[]
],
[
[]
],
[
[]
],
[
[]
],
[
[]
],
[
[]
],
[
[]
],
[
[]
]
],
“geo”: null,
“coordinates”: null,
“place”: null,
“contributors”: null,
“retweet_count”: 1,
“entities”: [
[
[
[
[
[]
],
[
[
[],
[]
]
]
],
[
[
[]
],
[
[
[],
[]
]
]
]
]
],
[
[
[
[
[]
],
[
[]
],
[
[]
],
[
[
[],
[]
]
]
],
[
[
[]
],
[
[]
],
[
[]
],
[
[
[],
[]
]
]
]
]
],
[
[]
]
],
“favorited”: false,
“retweeted”: false,
“possibly_sensitive”: false
}

I intend to collect ALL the hashtags from all the 20 json objects..So essentially I need to navigate inside entities to hashtags to text. But as seen above, the deserialization is only partial. It is not deserializing any nested stuff.

How do I fix this? Please help!

  • 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-11T18:46:37+00:00Added an answer on June 11, 2026 at 6:46 pm

    Good heavens! Got it from this stackoverflow question. Thanks @chill182!

    Here’s how you do it:

     ArrayList hashtags = new ArrayList();
    
                JArray jsonDat = JArray.Parse(response); 
                for(int x = 0; x < jsonDat.Count(); x++) 
                {
                    JObject entity = JObject.Parse(jsonDat[x]["entities"].ToString());
                    JArray arrHashtags = JArray.Parse(entity["hashtags"].ToString());
                    for(int i=0; i < arrHashtags.Count(); i++)
                    {
                        JObject hashtagstuff = JObject.Parse(arrHashtags[i].ToString());
                        hashtags.Add(hashtagstuff["text"].ToString());
                    }
                }
    

    Don’t forget to include Linq in the namespace 🙂

    using Newtonsoft.Json.Linq;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Maybe this is a poor question, but, I can't find a tutorial or even
Maybe this question has been asked before, but I couldn't find it. I am
Maybe it's because of the dark outside, but I can't get this Position geom_text
This is a general question, I believe it maybe a math question but it
Maybe the title is a little missleading but I'd like to ask you for
Maybe I just can't figure out the right keywords to get an answer out
Maybe it's wrong but I always use this query for my app: cme_only =
Maybe it's a newbie question, but is there a method in C/C++ to prevent
I thought to ask this as an update to my previous similar question but
I know this is a beginner's question, but I've been searching online and all

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.