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

  • Home
  • SEARCH
  • 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 6075243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:28:22+00:00 2026-05-23T10:28:22+00:00

I have completed a program that is outlined in chapter 3 of Head First

  • 0

I have completed a program that is outlined in chapter 3 of Head First Programming.
Basically, the program searches a website and stores the price on that page. Then depending on which option the user selects, a certain message will be sent to the user’s twitter account.

Source code from book’s website: http://headfirstlabs.com/books/hfprog/chapter03/page108.py

When I run my program, and run the source code from the book’s website, I get the same error.

Here is the error:

Traceback (most recent call last):
  File "C:\Users\Krysten\Desktop\Ch3.py", line 28, in <module>
    send_to_twitter(get_price())
  File "C:\Users\Krysten\Desktop\Ch3.py", line 14, in send_to_twitter
    resp = urllib.request.urlopen("http://twitter.com/statuses/update.json", params)
  File "C:\Python31\lib\urllib\request.py", line 121, in urlopen
    return _opener.open(url, data, timeout)
  File "C:\Python31\lib\urllib\request.py", line 356, in open
    response = meth(req, response)
  File "C:\Python31\lib\urllib\request.py", line 468, in http_response
    'http', request, response, code, msg, hdrs)
  File "C:\Python31\lib\urllib\request.py", line 394, in error
    return self._call_chain(*args)
  File "C:\Python31\lib\urllib\request.py", line 328, in _call_chain
    result = func(*args)
  File "C:\Python31\lib\urllib\request.py", line 476, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 401: Unauthorized

Is the error being caused because the book is somewhat outdated and twitter has to be accessed in a different way?

  • 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-23T10:28:23+00:00Added an answer on May 23, 2026 at 10:28 am

    In most of Twitter API, basic authentication is deprecated. Use OAuth API.

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

Sidebar

Related Questions

Okay. I have completed my first python program.It has around 1000 lines of code.
I have an update program that is completely independent of my main application. I
I am completely stumped. I have a program that pulls information stored in a
I'd like to have a python program alert me when it has completed its
how do i get a list of user that have completed or not completed
I have a program that's run in unix (that I have no control over)
I'm learning java and I have made simple program that simply reads value from
I wrote a program that employs multithreading for parallel computing. I have verified that
I am learning Objective-C and have completed a simple program and got an unexpected
I have a Java program that executes specific commands into the OS. Am also

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.