econchick / new-coder

New Coder tutorials
zlib License
597 stars 392 forks source link

A couple issued I noticed in API tutorial #212

Open joshuamsmith opened 8 years ago

joshuamsmith commented 8 years ago

Hello,

Really enjoying your tutorial! I wanted to reach out to point out a couple fixes that might help future readers from banging their heads on the keyboard:

adapted_price vs adjusted_price

on http://newcoder.io/api/part-3/ in the first section there is:

adapted_price = platform['adjusted_price'] but then you refer to variable adjusted_price a couple lines down. I think "adapted_price" is supposed to be "adjusted_price"

Endless loop

On page http://newcoder.io/api/part-1/ under the load_from_file method, the section you show to type out is not complete and has:

while not line.startswith("DATE "):
            pass

and leads to an endless loop, but looking in the completed source file it appears as:

            if not reached_dataset:
                if line.startswith("DATE "):
                    reached_dataset = True
                continue

403 forbidden with Giant Bomb

On api call was getting 403 errors until I added headers={'user-agent':'newcoder'} to the requests.get call