-
Notifications
You must be signed in to change notification settings - Fork 0
/
GetLivestoryJsonWithCurl.sh
executable file
·72 lines (61 loc) · 5.34 KB
/
GetLivestoryJsonWithCurl.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
curl 'https://data.api.cnn.io/graphql' \
-H 'authority: data.api.cnn.io' \
-H 'pragma: no-cache' \
-H 'cache-control: no-cache' \
-H 'sec-ch-ua: "Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"' \
-H 'accept: */*' \
-H 'x-graphql-query-uuid: livestory---PostsWithGraph{"livestory_id":"h_f887fc510d5e8ae829971ae452386965","startId":null}---6cfb637bd4a95bb97e5bd7ba14b0415b7a76d0dfdc83caf87662b319f1354af9' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36' \
-H 'x-api-key: P7LEOCujzt2RqSaWBeImz1spIoLq7dep7x983yQc' \
-H 'content-type: application/json' \
-H 'origin: https://www.cnn.com' \
-H 'sec-fetch-site: cross-site' \
-H 'sec-fetch-mode: cors' \
-H 'sec-fetch-dest: empty' \
-H 'referer: https://www.cnn.com/' \
-H 'accept-language: en-US,en;q=0.9,fr-FR;q=0.8,fr;q=0.7' \
--data-raw '{"operationName":"PostsWithGraph","variables":{"livestory_id":"h_f887fc510d5e8ae829971ae452386965","startId":null},"query":"query PostsWithGraph($livestory_id: String) {\n getLivestoryWebData(livestory_id: $livestory_id) {\n id\n lastPublishDate\n lastPublishDateFormatted\n activityStatus\n pinnedPosts {\n id\n lastPublishDate\n __typename\n }\n unpinnedPosts {\n id\n sourceId\n lastPublishDate\n lastPublishDateFormatted\n headline\n byline\n content\n tags\n __typename\n }\n tags\n __typename\n }\n}\n"}' \
--compressed > 05.json
cat 05.json | jq '[.data.getLivestoryWebData.unpinnedPosts[].content[].elements[].target | select(.type=="video") | [.id, .type, .cdnUrls.embedded_cc, .firstPublishDate, .sourceId, .attributes.thumbUrl]]' > livestory05.json
curl 'https://data.api.cnn.io/graphql' \
-H 'authority: data.api.cnn.io' \
-H 'pragma: no-cache' \
-H 'cache-control: no-cache' \
-H 'sec-ch-ua: "Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"' \
-H 'accept: */*' \
-H 'x-graphql-query-uuid: livestory---PostsWithGraph{"livestory_id":"h_834c94272fb36b70380195e1c7256113","startId":null}---fa2bffb0f77f457aed29f5c99641e0702b17d0461834e0a45f0af2ab62ce1fa8' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36' \
-H 'x-api-key: P7LEOCujzt2RqSaWBeImz1spIoLq7dep7x983yQc' \
-H 'content-type: application/json' \
-H 'origin: https://www.cnn.com' \
-H 'sec-fetch-site: cross-site' \
-H 'sec-fetch-mode: cors' \
-H 'sec-fetch-dest: empty' \
-H 'referer: https://www.cnn.com/' \
-H 'accept-language: en-US,en;q=0.9,fr-FR;q=0.8,fr;q=0.7' \
--data-raw '{"operationName":"PostsWithGraph","variables":{"livestory_id":"h_834c94272fb36b70380195e1c7256113","startId":null},"query":"query PostsWithGraph($livestory_id: String) {\n getLivestoryWebData(livestory_id: $livestory_id) {\n id\n lastPublishDate\n lastPublishDateFormatted\n activityStatus\n pinnedPosts {\n id\n lastPublishDate\n __typename\n }\n unpinnedPosts {\n id\n sourceId\n lastPublishDate\n lastPublishDateFormatted\n headline\n byline\n content\n tags\n __typename\n }\n tags\n __typename\n }\n}\n"}' \
--compressed > 06.json
cat 06.json | jq '[.data.getLivestoryWebData.unpinnedPosts[].content[].elements[].target | select(.type=="video") | [.id, .type, .cdnUrls.embedded_cc, .firstPublishDate, .sourceId, .attributes.thumbUrl]]' > livestory06.json
curl 'https://data.api.cnn.io/graphql' \
-H 'authority: data.api.cnn.io' \
-H 'pragma: no-cache' \
-H 'cache-control: no-cache' \
-H 'sec-ch-ua: "Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"' \
-H 'accept: */*' \
-H 'x-graphql-query-uuid: livestory---PostsWithGraph{"livestory_id":"h_0b89b5cffc92d90ef342dffa0053185f","startId":null}---a1c3c4c9a78f17cf330aee068136423a9273eee282f2f86d4e9ab8bd678b302f' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36' \
-H 'x-api-key: P7LEOCujzt2RqSaWBeImz1spIoLq7dep7x983yQc' \
-H 'content-type: application/json' \
-H 'origin: https://www.cnn.com' \
-H 'sec-fetch-site: cross-site' \
-H 'sec-fetch-mode: cors' \
-H 'sec-fetch-dest: empty' \
-H 'referer: https://www.cnn.com/' \
-H 'accept-language: en-US,en;q=0.9,fr-FR;q=0.8,fr;q=0.7' \
--data-raw '{"operationName":"PostsWithGraph","variables":{"livestory_id":"h_0b89b5cffc92d90ef342dffa0053185f","startId":null},"query":"query PostsWithGraph($livestory_id: String) {\n getLivestoryWebData(livestory_id: $livestory_id) {\n id\n lastPublishDate\n lastPublishDateFormatted\n activityStatus\n pinnedPosts {\n id\n lastPublishDate\n __typename\n }\n unpinnedPosts {\n id\n sourceId\n lastPublishDate\n lastPublishDateFormatted\n headline\n byline\n content\n tags\n __typename\n }\n tags\n __typename\n }\n}\n"}' \
--compressed > 07.json
cat 07.json | jq '[.data.getLivestoryWebData.unpinnedPosts[].content[].elements[].target | select(.type=="video") | [.id, .type, .cdnUrls.embedded_cc, .firstPublishDate, .sourceId, .attributes.thumbUrl]]' > livestory07.json