256 Kilobytes

Answers in Web Scraping, Data Analysis | By August R. Garcia

Published 3 weeks agoFri, 18 Oct 2019 07:49:38 -0700

83 views, 1 RAM, and 0 comments

Tags: Python, Twitter, HTTP Requests

Profile Photo - August R. Garcia August R. Garcia LARPing as a Sysadmi... Portland, OR
🗎 198 🗨 986 🐏 299
Site Owner

See code. Yeah, it seems like you do in fact have to make a bunch of additional HTTP requests.

def resolve_t_co(t_co_url):
        if t_co_url != None:
                return requests.get( t_co_url ).url 

urls = [
"https://t.co/eP5KQIUDBW"    ,   
"https://t.co/LC5Zjln2Wg"    ,   
"https://t.co/1nHwSk0JGr"    ,   
"https://t.co/zQvhJiak7x"    ,   
"https://t.co/LLHPhQiQX5"    ,   
"https://t.co/wMZAxhb9SZ"    ,   
"https://t.co/BB2M7f7rLO"    ,   
"https://t.co/BB2M7f7rLO"    ,   
"https://t.co/6QU0yEMff0"    ,   
"https://t.co/9G6sTbNrSo"    ,   
]

for url in urls: 
        print(url, resolve_t_co( url ) , sep="\t")

# Prints: 
# https://t.co/eP5KQIUDBW	https://grammar.yourdictionary.com/grammar-rules-and-tips/satire-writing-tips.html
# https://t.co/LC5Zjln2Wg	https://grammar.yourdictionary.com/grammar-rules-and-tips/basic-english-grammar-rules.html
# https://t.co/1nHwSk0JGr	https://www.yourdictionary.com/
# https://t.co/zQvhJiak7x	https://thesaurus.yourdictionary.com/disease
# https://t.co/LLHPhQiQX5	https://www.youtube.com/watch?v=kwdSbBwz4CU&feature=youtu.be&t=23
# https://t.co/wMZAxhb9SZ	https://examples.yourdictionary.com/examples-of-doublespeak.html
# https://t.co/BB2M7f7rLO	https://www.vox.com/policy-and-politics/2019/10/17/20919005/sondland-testimony-trump-impeachment-giuliani
# https://t.co/BB2M7f7rLO	https://www.vox.com/policy-and-politics/2019/10/17/20919005/sondland-testimony-trump-impeachment-giuliani
# https://t.co/6QU0yEMff0	https://www.logicallyfallacious.com/tools/lp/Bo/LogicalFallacies/10/Ad-Hominem-Guilt-by-Association
# https://t.co/9G6sTbNrSo	https://www.yourdictionary.com/gender

That feel when.

Users Who Have Downloaded More RAM:
Hash Brown (3 weeks ago)
🐏 ⨉ 1
Posted by August R. Garcia 3 weeks ago 🕓 Posted at 18 October, 2019 07:49 AM PDT

Sir, I can do you a nice SEO.

Post a New Comment

To leave a comment, login to your account or create an account.

Do you like having a good time?

Read Quality Articles

Read some quality articles. If you can manage to not get banned for like five minutes, you can even post your own articles.

View Articles →

Argue with People on the Internet

Use your account to explain why people are wrong on the Internet forum.

View Forum →

Vandalize the Wiki

Or don't. I'm not your dad.

View Wiki →

Ask and/or Answer Questions

If someone asks a terrible question, post a LMGTFY link.

View Answers →

Make Some Money

Hire freelancers and/or advertise your goods and/or services. Hire people directly. We're not a middleman or your dad. Manage your own business transactions.

Register an Account
You can also login to an existing account or recover your password. All use of this site is subject to terms outlined in the terms of service and privacy policy.