<jupyter_start><jupyter_text><jupyter_code>!pip install tweepy
!pip install savepagenow
import savepagenow
from time import sleep

# arc_url = savepagenow.capture_or_cache(urls[2])
# print(arc_url)

import json
import tweepy

auth = tweepy.OAuthHandler(T1, T2)
auth.set_access_token(T3, T4)
api = tweepy.API(auth)
User = "@OverflowCat" #758295043337617408
# Cursor is the search method this search query will return 20 of the users latest favourites just like the php api you referenced
favs = tweepy.Cursor(api.favorites, id=User).items(99)
urls = []
txts = []
for favorite in favs:
    # print('\n\n\nTweet Author:')
    # print('Screen Name: '+ favorite.user.screen_name)
    # print('Name: '+ favorite.user.name)
    # print('\nTweet:')
    # print('Tweet Id: ' + str(favorite.id))
    # print('Tweet Text: '+ favorite.text)
  urls.append("http://twitter.com/" + favorite.user.screen_name + "/status/" + str(favorite.id))
  txts.append(favorite.text)
print(urls)
arc_urls = []
for url in urls:
  arc_url = savepagenow.capture_or_cache(url)
  arc_urls.append(arc_url)
  sleep(5)<jupyter_output><empty_output><jupyter_text>The limit of an IP is **15 times per minute**. That is to say we'd better sleep for 5 secs.<jupyter_code>for i in arc_urls:
  print(i)
print(favs)
for f in favs:
  print(favs)

public_tweets = api.home_timeline()
for tweet in public_tweets:
    print(json.dumps(tweet._json, indent=2, sort_keys=True))<jupyter_output>{
  "contributors": null,
  "coordinates": null,
  "created_at": "Sun Feb 23 03:03:17 +0000 2020",
  "entities": {
    "hashtags": [],
    "media": [
      {
        "display_url": "pic.twitter.com/NHK2gdRNNE",
        "expanded_url": "https://twitter.com/Taoist_mark/status/1231414194425057281/photo/1",
        "id": 1231414187634479104,
        "id_str": "1231414187634479104",
        "indices": [
          22,
          45
        ],
        "media_url": "http://pbs.twimg.com/media/ERbcrelUUAABSc8.jpg",
        "media_url_https": "https://pbs.twimg.com/media/ERbcrelUUAABSc8.jpg",
        "sizes": {
          "large": {
            "h": 512,
            "resize": "fit",
            "w": 512
          },
          "medium": {
            "h": 512,
            "resize": "fit",
            "w": 512
          },
          "small": {
            "h": 512,
            "resize": "fit",
            "w": 512
          },
          "thumb": {
            "h": 150,
            "resize": "crop",
[...]
{'fraction_non_alphanumeric': 0.15079689415610953, 'fraction_numerical': 0.054760931753167146, 'mean_word_length': 2.737404580152672, 'pattern_counts': {'":': 29, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '91623', 'license': 'MIT', 'n_tokens_mistral': 995, 'n_tokens_neox': 899, 'n_words': 184, 'path': 'archive twitter likes.ipynb', 'repo_name': 'OverflowCat/AutoArchive', 'size': '2447'}