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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:59:09+00:00 2026-06-11T11:59:09+00:00

I’m using Twython (Python wrapper for Twitter API, found here .) Objective: I’m trying

  • 0

I’m using Twython (Python wrapper for Twitter API, found here.)

Objective: I’m trying to make a simple bot that searches for a keyword and replies to tweets with the keyword in them.

Example: Send search request to search for #stackoverflow, reply to tweets that have #stackoverflow in them with “StackOverflow is the best!”

Problem: Can’t reply to a tweet without the tweet id (found in the url of any permalinked tweet). An example of this would be to take any tweet and link someone to it. The number at the end of the link is the tweet id.

What I’ve Tried: There’s not much I can try. I want this to be as simple as possible, with no complex workarounds. I’m sure there’s some way to do this without having to go too far out of my way. I’ve exhausted Google and Twython’s documentation and Twitter’s API documentation. =/ Anyone

  • 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-11T11:59:10+00:00Added an answer on June 11, 2026 at 11:59 am

    Tweets are just python dictionaries, and their contents echo the Tweet resource exactly. Each tweet thus has an id_str key:

    print tweet['id_str']
    

    You can always print data structures if things are not clear; I can recommend the pprint.pprint() function to make nested python structures extra readable:

    import pprint
    
    pprint.pprint(tweet)
    

    Example session:

    >>> from twython import Twython
    >>> t = Twython()
    >>> res = t.search(q='python')
    >>> res.keys()
    [u'next_page', u'completed_in', u'max_id_str', u'since_id_str', u'refresh_url', u'results', u'since_id', u'results_per_page', u'query', u'max_id', u'page']
    >>> from pprint import pprint
    >>> pprint(res[u'results'][0])
    {u'created_at': u'Mon, 17 Sep 2012 21:01:12 +0000',
     u'from_user': u'Me_Craay_GOOFY',
     u'from_user_id': 230100184,
     u'from_user_id_str': u'230100184',
     u'from_user_name': u'\u06deSuperFLY_PUER\u06de\u2122',
     u'geo': None,
     u'id': 247802407529115649,
     u'id_str': u'247802407529115649',
     u'iso_language_code': u'en',
     u'metadata': {u'result_type': u'recent'},
     u'profile_image_url': u'http://a0.twimg.com/profile_images/2617747450/345616051_normal.jpg',
     u'profile_image_url_https': u'https://si0.twimg.com/profile_images/2617747450/345616051_normal.jpg',
     u'source': u'<a href="http://globalgrind.com">UncleUber for Blackberry</a>',
     u'text': u'RT @Mr_Oyato: #ViolentPrayers May the python of breakthrough swallow you and your household today.',
     u'to_user': None,
     u'to_user_id': 0,
     u'to_user_id_str': u'0',
     u'to_user_name': None}
    >>> res[u'results'][0]['id_str']
    u'247802407529115649'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a simple page using Google Maps API 3. My first. One marker
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to create an if statement in PHP that prevents a single post
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is

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.