[twitter] add 'protected' metadata field (#5327)
for 'author' and 'user'
This commit is contained in:
@@ -380,6 +380,7 @@ class TwitterExtractor(Extractor):
|
|||||||
"date" : text.parse_datetime(
|
"date" : text.parse_datetime(
|
||||||
uget("created_at"), "%a %b %d %H:%M:%S %z %Y"),
|
uget("created_at"), "%a %b %d %H:%M:%S %z %Y"),
|
||||||
"verified" : uget("verified", False),
|
"verified" : uget("verified", False),
|
||||||
|
"protected" : uget("protected", False),
|
||||||
"profile_banner" : uget("profile_banner_url", ""),
|
"profile_banner" : uget("profile_banner_url", ""),
|
||||||
"profile_image" : uget(
|
"profile_image" : uget(
|
||||||
"profile_image_url_https", "").replace("_normal.", "."),
|
"profile_image_url_https", "").replace("_normal.", "."),
|
||||||
|
|||||||
@@ -72,6 +72,59 @@ __tests__ = (
|
|||||||
"#class" : twitter.TwitterTimelineExtractor,
|
"#class" : twitter.TwitterTimelineExtractor,
|
||||||
"#range" : "1-40",
|
"#range" : "1-40",
|
||||||
"#sha1_url": "c570ac1aae38ed1463be726cc46f31cac3d82a40",
|
"#sha1_url": "c570ac1aae38ed1463be726cc46f31cac3d82a40",
|
||||||
|
|
||||||
|
"author": {
|
||||||
|
"date" : "dt:2015-01-12 10:25:22",
|
||||||
|
"description" : "The very best nature pictures.",
|
||||||
|
"favourites_count": int,
|
||||||
|
"followers_count" : int,
|
||||||
|
"friends_count" : int,
|
||||||
|
"listed_count" : int,
|
||||||
|
"media_count" : int,
|
||||||
|
"statuses_count" : int,
|
||||||
|
"id" : 2976459548,
|
||||||
|
"location" : "Earth",
|
||||||
|
"name" : "supernaturepics",
|
||||||
|
"nick" : "Nature Pictures",
|
||||||
|
"profile_banner" : "https://pbs.twimg.com/profile_banners/2976459548/1421058583",
|
||||||
|
"profile_image" : "https://pbs.twimg.com/profile_images/554585280938659841/FLVAlX18.jpeg",
|
||||||
|
"protected" : False,
|
||||||
|
"verified" : False,
|
||||||
|
},
|
||||||
|
"user": {
|
||||||
|
"date" : "dt:2015-01-12 10:25:22",
|
||||||
|
"description" : "The very best nature pictures.",
|
||||||
|
"favourites_count": int,
|
||||||
|
"followers_count" : int,
|
||||||
|
"friends_count" : int,
|
||||||
|
"listed_count" : int,
|
||||||
|
"media_count" : int,
|
||||||
|
"statuses_count" : int,
|
||||||
|
"id" : 2976459548,
|
||||||
|
"location" : "Earth",
|
||||||
|
"name" : "supernaturepics",
|
||||||
|
"nick" : "Nature Pictures",
|
||||||
|
"profile_banner" : "https://pbs.twimg.com/profile_banners/2976459548/1421058583",
|
||||||
|
"profile_image" : "https://pbs.twimg.com/profile_images/554585280938659841/FLVAlX18.jpeg",
|
||||||
|
"protected" : False,
|
||||||
|
"verified" : False,
|
||||||
|
},
|
||||||
|
"tweet_id" : range(400000000000000000, 800000000000000000),
|
||||||
|
"conversation_id": range(400000000000000000, 800000000000000000),
|
||||||
|
"quote_id" : 0,
|
||||||
|
"reply_id" : 0,
|
||||||
|
"retweet_id" : 0,
|
||||||
|
"count" : range(1, 4),
|
||||||
|
"num" : range(1, 4),
|
||||||
|
"favorite_count" : int,
|
||||||
|
"quote_count" : int,
|
||||||
|
"reply_count" : int,
|
||||||
|
"retweet_count" : int,
|
||||||
|
"content" : str,
|
||||||
|
"lang" : str,
|
||||||
|
"date" : "type:datetime",
|
||||||
|
"sensitive" : False,
|
||||||
|
"source" : "nature_pics",
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user