How can I select the date range in Google News RSS feed or create RSS feed with date range from Google Search? - rss

I'd like to create a RSS feed for Google News results by specific date ranges and keywords for a data mining paper with R, but struggeling to get the date range in an RSS feed.
Option1: Date range missing:
In am able to create the google news rss feed with my search terms "corona" and "nameofnewspaper", however I am only able to select the past X days (here past 150 days: when%3A150d), not a specific range:
https://news.google.com/rss/search?q=corona%20%22supplychaindigital%22%20when%3A150d&hl=en-US&gl=US&ceid=US%3Aen
Option2: RSS feed with date range missing:
Eventhough in the google search under "news" and tools, I am able to select the date range, I am struggeling to convert the below link into an RSS feed, as under the create alert option besides being able to deliver to RSS feed, I cannot find an option to select the date range (so only new newsarticle appear).
https://www.google.com/search?biw=1440&bih=821&tbs=cdr%3A1%2Ccd_min%3A2%2F1%2F2020%2Ccd_max%3A4%2F30%2F2020&tbm=nws&sxsrf=ALeKk010FiyrQr8gLE8tNT0L_whYBj8kTA%3A1597216127002&ei=fpUzX6mmPMqckgXPhIGoDg&q=corona+supplychaindigital.com+&oq=corona+supplychaindigital.com+&gs_l=psy-ab.3...9626.9626.0.10010.1.1.0.0.0.0.84.84.1.1.0....0...1c.1.64.psy-ab..0.0.0....0.86vAiNLAf0E
Do you know of any other option to obtain both RSS feed and date range?
Thanks a lot for your help!
Best,
Vivi

An option is: newsapi.org
The following URL request search articles mentioning "xbox" from date range "2020-08-01 to 2020-08-03":
http://newsapi.org/v2/everything?q=xbox&from=2020-08-01&to=2020-08-03&sortBy=popularity&apiKey=[API_KEY]
And these are the first 20 results:
{
"status": "ok",
"totalResults": 1746,
"articles": [
{
"source": {
"id": null,
"name": "Theinventory.com"
},
"author": "The Inventory Staff on Kinja Deals, shared by Elizabeth Henges to Lifehacker",
"title": "Sunday's Best Deals: Right Angle Clamps, Bath Towels, John Wick, Packs of Masks, and More",
"description": "A deal on John Wick 4K Blu-Rays, Tie Bar’s 5 packs of masks, a deal on a fight stick, bathroom towels for $30, and more are some of Sunday’s best deals.Read more...",
"url": "https://kinjadeals.theinventory.com/sundays-best-deals-right-angle-clamps-bath-towels-jo-1844585414",
"urlToImage": "https://i.kinja-img.com/gawker-media/image/upload/c_fill,f_auto,fl_progressive,g_center,h_675,pg_1,q_80,w_1200/djgb7gtjehmfjzytbef1.jpg",
"publishedAt": "2020-08-02T14:40:00Z",
"content": "A deal on John Wick 4K Blu-Rays, Tie Bars 5 packs of masks, a deal on a fight stick, bathroom towels for $30, and more are some of Sundays best deals.\r\nBookmark Kinja Deals and follow us on Twitter t… [+35497 chars]"
},
{
"source": {
"id": "engadget",
"name": "Engadget"
},
"author": "Jon Fingas",
"title": "Classic 'Halo' games will get crossplay and custom game browsing in 2020",
"description": "The Halo games in the Master Chief Collection should soon get many of the features you’re used to with modern shooters. The 343 Industries team has provided (via Eurogamer) an MCC “snapshot” indicating that several welcome additions are coming to the classic …",
"url": "https://www.engadget.com/halo-master-chief-collection-crossplay-2020-212636400.html",
"urlToImage": "https://o.aolcdn.com/images/dims?resize=1200%2C630&crop=1200%2C630%2C0%2C0&quality=95&image_uri=https%3A%2F%2Fs.yimg.com%2Fos%2Fcreatr-uploaded-images%2F2020-08%2Fe7b52340-d4f7-11ea-9f73-cf1f814f40a2&client=amp-blogside-v2&signature=346daafa2e86ec849f8c4a7f24e8a6b492af6ee8",
"publishedAt": "2020-08-02T21:26:36Z",
"content": "The Halo games in the Master Chief Collection should soon get many of the features you’re used to with modern shooters. The 343 Industries team has provided (via Eurogamer) an MCC “snapshot” indicati… [+609 chars]"
},
{
"source": {
"id": "engadget",
"name": "Engadget"
},
"author": "Igor Bonifacic",
"title": "Spider-Man is coming to the PlayStation version of 'Marvel's Avengers'",
"description": "Marvel's Avengers on Sony platforms will feature an exclusive hero: Spider-Man. Developer Crystal Dynamics said it plans to add the superhero to the PlayStation version of the upcoming game in early 2021. The studio didn't say whether Spider-Man will make his…",
"url": "https://www.engadget.com/spider-man-marvels-avengers-190545589.html",
"urlToImage": "https://o.aolcdn.com/images/dims?resize=1200%2C630&crop=1200%2C630%2C0%2C0&quality=95&image_uri=https%3A%2F%2Fs.yimg.com%2Fos%2Fcreatr-uploaded-images%2F2020-08%2F9ba08af0-d5b8-11ea-bffa-efbdb30617c0&client=amp-blogside-v2&signature=896162a760da4142c0ef09eb4012101329437ed0",
"publishedAt": "2020-08-03T19:05:45Z",
"content": "It's not too surprising to find out Spider-Man is only coming to PlayStation. After all, Sony recently published an exclusive featuring Peter Parker and is working on a standalone title starring Mile… [+587 chars]"
},
{
"source": {
"id": "engadget",
"name": "Engadget"
},
"author": "Mariella Moon",
"title": "Netflix is making a film based on Ubisoft's 'Beyond Good & Evil'",
"description": "Netflix is working on a feature film adaptation of Ubisoft’s Beyond Good & Evil, the streaming platform has revealed on Twitter. According to The Hollywood Reporter, the project is still in early development and still in in the midst of looking for writers. I…",
"url": "https://www.engadget.com/beyond-good-and-evil-movie-070207377.html",
"urlToImage": "https://o.aolcdn.com/images/dims?resize=1200%2C630&crop=1200%2C630%2C0%2C0&quality=95&image_uri=https%3A%2F%2Fs.yimg.com%2Fos%2Fcreatr-uploaded-images%2F2020-08%2F833e5280-d39c-11ea-9af3-f172f82ea909&client=amp-blogside-v2&signature=541ba6f91ec2771f202dfdf36f56132f213c5da2",
"publishedAt": "2020-08-01T07:02:07Z",
"content": "Netflix is working on a feature film adaptation of Ubisoft’s Beyond Good & Evil, the streaming platform has revealed on Twitter. According to The Hollywood Reporter, the project is still in early… [+1059 chars]"
},
{
"source": {
"id": "reuters",
"name": "Reuters"
},
"author": "Reuters Editorial",
"title": "Take-Two raises sales forecast as videogames get stay-at-home boost - Reuters UK",
"description": "Take-Two Interactive Software Inc on Monday raised its fiscal year adjusted sales forecast after beating quarterly estimates on demand for its videogame franchises \"Grand Theft Auto\" and \"NBA 2K\" from people stuck at home due to lockdowns.",
"url": "https://uk.reuters.com/article/uk-take-two-results-idUKKCN24Z2R5",
"urlToImage": "https://s4.reutersmedia.net/resources_v2/images/rcom-default.png",
"publishedAt": "2020-08-03T22:43:00Z",
"content": "(Reuters) - Take-Two Interactive Software Inc (TTWO.O) on Monday raised its fiscal year adjusted sales forecast after beating quarterly estimates on demand for its videogame franchises “Grand Theft A… [+1734 chars]"
},
{
"source": {
"id": null,
"name": "Android Central"
},
"author": "Samuel Tolbert",
"title": "Spider-Man swings into Marvel's Avengers in 2021 — but only on PS5 and PS4",
"description": "Your friendly neighborhood hero isn't coming to all platforms.\n\nWhat you need to know\n\n\nMarvel's Avengers will have heroes added post-launch for free.\nSpider-Man is joining the roster in 2021, exclusively on PS4 and PS5.\nMarvel's Avengers is set to release on…",
"url": "https://www.androidcentral.com/spider-man-marvels-avengers-exclusive-ps4-ps5-2021",
"urlToImage": "https://www.androidcentral.com/sites/androidcentral.com/files/styles/large/public/article_images/2020/08/marvels-avengers-spidey.jpg",
"publishedAt": "2020-08-03T17:24:53Z",
"content": "PlayStation has the marketing deal for the upcoming Marvel's Avengers but there's even more to the partnership. Today, Square Enix and Crystal Dynamics revealed via PlayStation Blog that Spider-Man i… [+927 chars]"
},
{
"source": {
"id": null,
"name": "Android Central"
},
"author": "Samuel Tolbert",
"title": "Monster Hunter World has now sold over 16 million copies",
"description": "An absolute behemoth that keeps on going.\n\nWhat you need to know\n\n\nCapcom has shared its financial results for Q1 of fiscal year 2021.\nMonster Hunter World has now sold over 16 million copies sold.\nResident Evil 3 has crossed 2.7 million copies sold.\n\n\nLike s…",
"url": "https://www.androidcentral.com/monster-hunter-world-sold-16-million-copies-capcom-q1-results",
"urlToImage": "https://www.androidcentral.com/sites/androidcentral.com/files/styles/large/public/field/image/2020/01/monster_hunter_world_iceborne_barioth-b73h.jpg",
"publishedAt": "2020-08-03T22:25:49Z",
"content": "Like so many other companies over the last week, Capcom has shared its results for Q1 of fiscal year 2021, ending June 30, 2020. Monster Hunter World: Iceborne is continuing to sell extremely well an… [+584 chars]"
},
{
"source": {
"id": null,
"name": "Android Central"
},
"author": "Samuel Tolbert",
"title": "Grand Theft Auto V has sold almost 135 million copies",
"description": "If you think this game doesn't have life left in it, think again.\n\nWhat you need to know\n\n\nTake-Two Interactive has posted its financial results for Q1 of financial year 2021.\nGrand Theft Auto V has now sold almost 135 million copies.\nBorderlands 3 has crosse…",
"url": "https://www.androidcentral.com/take-two-interactive-q1-results-gta-v-135-million",
"urlToImage": "https://www.androidcentral.com/sites/androidcentral.com/files/styles/large/public/field/image/2020/08/grand-theft-auto-v-promo-image-2-703w.jpg",
"publishedAt": "2020-08-03T21:24:37Z",
"content": "Take-Two Interactive has shared its Q1 results for the 2021 fiscal year. Net bookings for the quarter totalled $996.2 million, which is up 136% year-over-year. Game sales remain strong overall as rep… [+1139 chars]"
},
{
"source": {
"id": null,
"name": "Android Central"
},
"author": "John Levite",
"title": "Grab a budget 4K TV with Vizio's 50-inch smart TV on sale for $290",
"description": "The Vizio V505-H19 50-inch 4K smart TV has dropped to $289.99 at Costco. This is Vizio's 2020 entry-level 4K TV, so it's already down to as low a price as is possible for a TV like this. That price is usually $300, though, and right now Costco is giving you a…",
"url": "https://www.androidcentral.com/grab-budget-4k-tv-vizios-50-inch-smart-tv-sale-290",
"urlToImage": "https://www.androidcentral.com/sites/androidcentral.com/files/styles/large/public/article_images/2020/08/vizio-50-inch.jpg",
"publishedAt": "2020-08-03T12:49:24Z",
"content": "The Vizio V505-H19 50-inch 4K smart TV has dropped to $289.99 at Costco. This is Vizio's 2020 entry-level 4K TV, so it's already down to as low a price as is possible for a TV like this. That price i… [+2075 chars]"
},
{
"source": {
"id": null,
"name": "Theguardian.comgames"
},
"author": "Simon Parkin",
"title": "Carrion review – flesh-eating fun",
"description": "(Phobia Game Studio/Devolver; Switch, PC and Xbox One)Inspired by a 1950s sci-fi horror movie, Carrion turns you into a malign marauding blob, swallowing scientists wholeCarrion borrows the premise of Irvin Yeaworth’s 1958 science fiction horror film The Blob…",
"url": "https://amp.theguardian.comgames/2020/aug/01/carrion-review-flesh-eating-fun",
"urlToImage": "https://i.guim.co.uk/img/media/462e2e8b586b8ca5901111a95cc126f007d98843/60_0_1800_1080/master/1800.jpg?width=1200&height=630&quality=85&auto=format&fit=crop&overlay-align=bottom%2Cleft&overlay-width=100p&overlay-base64=L2ltZy9zdGF0aWMvb3ZlcmxheXMvdGctcmV2aWV3LTQucG5n&enable=upscale&s=0baafe079acbb37fb9805c4a3915f4cf",
"publishedAt": "2020-08-01T12:00:42Z",
"content": "Carrion borrows the premise of Irvin Yeaworths 1958 science fiction horror film The Blob, in which a young Steve McQueen takes on a corrosive, human-gobbling alien biomass, but casts you in the role … [+2183 chars]"
},
{
"source": {
"id": "business-insider",
"name": "Business Insider"
},
"author": "Palmer Haasch",
"title": "TikTok users are heaping praise on Microsoft after news broke that the company is in talks to buy the app",
"description": "<ul>\n<li>President Trump told reporters on July 31 that he was planning on banning TikTok in the United States, causing concern among many of the app's users and influencers. </li>\n<li>TikTok was not banned over the weekend, and Microsoft has confirmed that i…",
"url": "https://www.businessinsider.com/tiktok-ban-trump-microsoft-acquisition-making-memes-stanning-2020-8",
"urlToImage": "https://i.insider.com/5f2846e04e52b715b01f02cf?width=1200&format=jpeg",
"publishedAt": "2020-08-03T19:01:42Z",
"content": "TikTok was sent into a tizzy after President Trump told reporters late Friday night on Air Force One that he was planning on banning TikTok in the United States. Three days later, TikTok is still run… [+2741 chars]"
},
{
"source": {
"id": null,
"name": "VG247"
},
"author": "Cian Maher",
"title": "Craig the Brute is the “official Xbox mascot,” says Phil Spencer - VG247",
"description": "<ol><li>Craig the Brute is the “official Xbox mascot,” says Phil Spencer  VG247\r\n</li><li>Craig the Brute is ‘official Xbox mascot’, as Xbox Game Pass rebranded  Metro.co.uk\r\n</li><li>Halo Infinite multiplayer will be free-to-play  GamesIndustry.biz\r\n</li><li…",
"url": "https://www.vg247.com/2020/08/02/craig-the-brute-xbox-mascot/",
"urlToImage": "https://assets.vg247.com/current//2020/07/craig-the-brute.png",
"publishedAt": "2020-08-02T17:35:27Z",
"content": "If you know anything at all about Halo Infinite, you’ll probably know that every Halo fan on the planet loves Craig the Brute.\r\nWhat’s that? You don’t know Craig? That’s okay, I’ve posted a photo of … [+2049 chars]"
},
{
"source": {
"id": null,
"name": "Push Square"
},
"author": "Push Square",
"title": "More Rumours of 'Major' Third Party PS5 Exclusives Return - Push Square",
"description": "<ol><li>More Rumours of 'Major' Third Party PS5 Exclusives Return  Push Square\r\n</li><li>All PS5 and Xbox Series X games that support 120fps  Eurogamer.net\r\n</li><li>Xbox Series X games are OFF THE CHAIN – Microsoft's Matt Booty explains how  T3\r\n</li><li>PS5…",
"url": "https://www.pushsquare.com/news/2020/08/more_rumours_of_major_third_party_ps5_exclusives_return",
"urlToImage": "https://images.pushsquare.com/e359e7c9f632d/1280x720.jpg",
"publishedAt": "2020-08-01T19:30:00Z",
"content": "Rumours have been flying around for a while with regards to Sony tying down significant deals with third party publishers. Whispers say that the Japanese giant has secured a number of major franchise… [+1816 chars]"
},
{
"source": {
"id": null,
"name": "Push Square"
},
"author": "Push Square",
"title": "PS5 Fans Hyped After Sony Updates Future of Gaming Playlist - Push Square",
"description": "<ol><li>PS5 Fans Hyped After Sony Updates Future of Gaming Playlist  Push Square\r\n</li><li>PS5: Sony's New Tv's Are Finally Here!  TheGamer\r\n</li><li>All PS5 and Xbox Series X games that support 120fps  Eurogamer.net\r\n</li><li>Leaker Reveals When PS5 and Xbox…",
"url": "https://www.pushsquare.com/news/2020/08/ps5_fans_hyped_after_sony_updates_future_of_gaming_playlist",
"urlToImage": "https://images.pushsquare.com/16fc29ebad24a/1280x720.jpg",
"publishedAt": "2020-08-01T15:30:00Z",
"content": "Sony has updated its Future of Gaming playlist on YouTube, which compiled all of the announcements from its recent PlayStation 5 reveal event. This could be the first hint that fresh news is on the w… [+570 chars]"
},
{
"source": {
"id": null,
"name": "About Chromebooks"
},
"author": "Kevin C. Tofel",
"title": "Bought a Chromebook released after July 2017? You've got Stadia Pro free for three months - About Chromebooks",
"description": "<ol><li>Bought a Chromebook released after July 2017? You've got Stadia Pro free for three months  About Chromebooks\r\n</li><li>Chromebook owners can claim a free three-month Stadia Pro trial now  MobileSyrup\r\n</li><li>Not Dead Yet: Google Stadia 2020 Review &…",
"url": "https://www.aboutchromebooks.com/news/bought-a-chromebook-released-after-july-2017-youve-got-stadia-pro-free-for-three-months/",
"urlToImage": "https://www.aboutchromebooks.com/wp-content/uploads/2020/08/stadia-pro-perk.jpg",
"publishedAt": "2020-08-02T19:27:00Z",
"content": "Another week brings another perk to Chromebooks, following on last weeks deal for 100 GB of Dropbox storage. This week you can snag three free months of Stadia Pro, which is a value of $29.97 at the … [+3340 chars]"
},
{
"source": {
"id": null,
"name": "Metro.co.uk"
},
"author": "GameCentral",
"title": "Games Inbox: Will Sony make PS5 online free? - Metro.co.uk",
"description": "<ol><li>Games Inbox: Will Sony make PS5 online free?  Metro.co.uk\r\n</li><li>Xbox Series X SHOCK tactic does the unthinkable - leaves PS5 in the dust  T3\r\n</li><li>The Best PS4 Games of All Time  IGN Africa\r\n</li><li>Guide: New PS4 Games This Week (3rd August …",
"url": "https://metro.co.uk/2020/08/03/games-inbox-ps5-online-free-keeping-fit-video-games-lego-nes-kids-13073746/",
"urlToImage": "https://i2.wp.com/metro.co.uk/wp-content/uploads/2013/06/sony_psn_logo-e1420448700237_1596400283.jpg?quality=90&strip=all&w=1200&h=630&crop=1&zoom=1&ssl=1",
"publishedAt": "2020-08-03T00:00:00Z",
"content": "Could Microsoft force it to become free? (pic: Sony)\r\nThe Monday Inbox asks whether loading times are the next gen killer app, as the Sega Saturn gets compared to the Xbox Series X and PS5.\r\nTo join … [+14501 chars]"
},
{
"source": {
"id": null,
"name": "Tom's Guide"
},
"author": "Mark Spoonauer",
"title": "How to watch Samsung Unpacked: Galaxy Note 20, Galaxy Watch 3, Galaxy Buds Live and more - Tom's Guide UK",
"description": "<ol><li>How to watch Samsung Unpacked: Galaxy Note 20, Galaxy Watch 3, Galaxy Buds Live and more  Tom's Guide UK\r\n</li><li>The Huawei Mate Xs is still the best foldable phone you can buy, but it's not perfect  TechRadar\r\n</li><li>Leaked Galaxy Note 20 5G, Not…",
"url": "https://www.tomsguide.com/news/how-to-watch-samsung-unpacked-galaxy-note-20-galaxy-watch-3-galaxy-buds-live-and-more",
"urlToImage": "https://cdn.mos.cms.futurecdn.net/wMMZxCh54neQEZsof4AxE6-1200-80.jpeg",
"publishedAt": "2020-08-03T05:00:00Z",
"content": "After months of speculation — and lots and lots of leaks — Samsung is finally ready to take the wraps off of the Galaxy Note 20 along with four other devices.\r\nSamsung has said that it will be showin… [+4370 chars]"
},
{
"source": {
"id": null,
"name": "ReadWrite"
},
"author": "Saurabh Hooda",
"title": "10 Best Artificial Intelligence Software",
"description": "Progressive utilization of Artificial Intelligence software in the market for computerization of the procedures, programming, and other purposes has become common. AI-based platforms feature profound machine calculations and learning for robotizing business p…",
"url": "https://readwrite.com/2020/08/03/10-best-artificial-intelligence-software/",
"urlToImage": "https://images.readwrite.com/wp-content/uploads/2020/06/10-Best-Artificial-Intelligence-Software.jpg",
"publishedAt": "2020-08-03T15:00:24Z",
"content": "Progressive utilization of Artificial Intelligence software in the market for computerization of the procedures, programming, and other purposes has become common. AI-based platforms feature profound… [+12831 chars]"
},
{
"source": {
"id": null,
"name": "Kotaku"
},
"author": "Riley MacLeod",
"title": "The Week In Games: Fall Guys Horizons",
"description": "We’re in a bit of the summer doldrums for big games, but there’s still plenty to get excited about. Fall Guys comes to PS4 and PC this week. There’s a Fast & Furious game. And Horizon Zero Dawn makes its PC debut. Read more...",
"url": "https://kotaku.com/the-week-in-games-fall-guys-horizons-1844587781",
"urlToImage": "https://i.kinja-img.com/gawker-media/image/upload/c_fill,f_auto,fl_progressive,g_center,h_675,pg_1,q_80,w_1200/knsjyjakx5jwz0upgl4n.jpg",
"publishedAt": "2020-08-02T21:16:00Z",
"content": "Were in a bit of the summer doldrums for big games, but theres still plenty to get excited about. Fall Guys comes to PS4 and PC this week. Theres a Fast & Furious game. And Horizon Zero Dawn make… [+1368 chars]"
},
{
"source": {
"id": null,
"name": "Kotaku"
},
"author": "S.E. Doster",
"title": "Call Of Duty Is Finally Blowing The Top Off The Warzone Stadium",
"description": "Warzone’s stadium explosion was officially revealed with today’s Call of Duty: Modern Warfare trailer. The teased event will finally come to fruition with Season 5, which kicks off on August 5 across PlayStation 4, Xbox One, and PC.Read more...",
"url": "https://kotaku.com/call-of-duty-is-finally-blowing-the-top-off-the-warzone-1844596249",
"urlToImage": "https://i.kinja-img.com/gawker-media/image/upload/c_fill,f_auto,fl_progressive,g_center,h_675,pg_1,q_80,w_1200/mdrhaqrxmxilgwghjeuq.jpg",
"publishedAt": "2020-08-03T23:00:00Z",
"content": "Warzones stadium explosion was officially revealed with todays Call of Duty: Modern Warfare trailer. The teased event will finally come to fruition with Season 5, which kicks off on August 5 across P… [+1473 chars]"
}
]
}

Related

Redux - updating store based on async api calls

I have a use case to render page using redux with graphql api calls.
On first component will call default action to fetch data from graphql, and stores in redux state as below
state = { films: {
totalCount: 6,
films: [
{
created: '2014-12-10T14:23:31.880000Z',
id: 'ZmlsbXM6MQ==',
director: 'George Lucas',
title: 'A New Hope'
},
{
created: '2014-12-12T11:26:24.656000Z',
id: 'ZmlsbXM6Mg==',
director: 'Irvin Kershner',
title: 'The Empire Strikes Back'
},
{
created: '2014-12-18T10:39:33.255000Z',
id: 'ZmlsbXM6Mw==',
director: 'Richard Marquand',
title: 'Return of the Jedi'
}
]
}
}
and will show UI like below
Films demo app UI screenshot
Once placed in individual component (Film), i have to make service call to get film details by id ( this calls will be async to fetch data and has to store in state.
Will get data as below
{ "data": {
"film": {
"id": "ZmlsbXM6NQ==",
"title": "Attack of the Clones",
"created": "2014-12-20T10:57:57.886000Z",
"director": "George Lucas",
"releaseDate": "2002-05-16",
"episodeID": 2,
"openingCrawl": "There is unrest in the Galactic\r\nSenate. Several thousand solar\r\nsystems have declared their\r\nintentions to leave the Republic.\r\n\r\nSenator Amidala, the former\r\nQueen of Naboo, is returning\r\nto the Galactic Senate to vote\r\non the critical issue of creating\r\nan ARMY OF THE REPUBLIC\r\nto assist the overwhelmed\r\nJedi....",
"producers": [
"Rick McCallum"
]
}
}
}
Now i have to update my state like below, so that i can show all film data in individual (Film) component
state = { films: {
totalCount: 6,
films: [
{
"id": "ZmlsbXM6NQ==",
"title": "Attack of the Clones",
"created": "2014-12-20T10:57:57.886000Z",
"director": "George Lucas",
"releaseDate": "2002-05-16",
"episodeID": 2,
"openingCrawl": "There is unrest in the Galactic\r\nSenate. Several thousand solar\r\nsystems have declared their\r\nintentions to leave the Republic.\r\n\r\nSenator Amidala, the former\r\nQueen of Naboo, is returning\r\nto the Galactic Senate to vote\r\non the critical issue of creating\r\nan ARMY OF THE REPUBLIC\r\nto assist the overwhelmed\r\nJedi....",
"producers": [
"Rick McCallum"
]
},
{
"id": "ZmlsbXM6Mg==",
"title": "The Empire Strikes Back",
"created": "2014-12-12T11:26:24.656000Z",
"director": "Irvin Kershner",
"releaseDate": "2002-05-16",
"episodeID": 2,
"openingCrawl": "There is unrest in the Galactic\r\nSenate. Several thousand solar\r\nsystems have declared their\r\nintentions to leave the Republic.\r\n\r\nSenator Amidala, the former\r\nQueen of Naboo, is returning\r\nto the Galactic Senate to vote\r\non the critical issue of creating\r\nan ARMY OF THE REPUBLIC\r\nto assist the overwhelmed\r\nJedi....",
"producers": [
"Rick McCallum"
]
},
{
"id": "ZmlsbXM6Mw==",
"title": "Return of the Jedi",
"created": "2014-12-18T10:39:33.255000Z",
"director": "Richard Marquand",
"releaseDate": "2002-05-16",
"episodeID": 2,
"openingCrawl": "There is unrest in the Galactic\r\nSenate. Several thousand solar\r\nsystems have declared their\r\nintentions to leave the Republic.\r\n\r\nSenator Amidala, the former\r\nQueen of Naboo, is returning\r\nto the Galactic Senate to vote\r\non the critical issue of creating\r\nan ARMY OF THE REPUBLIC\r\nto assist the overwhelmed\r\nJedi....",
"producers": [
"Rick McCallum"
]
}
]
}
}
When i am trying action to fetch Film by id (async calls using api middleware) in Film component, its calling and trying to update but all actions are looping and not working properly.
Please help me to understand and use redux actions properly.
App Codesandbox link https://codesandbox.io/s/adoring-jang-bf2f8m
Verify the console logs, can see actions looping....
Thanks.
Update::
Updated the above app to #redux/toolkit, below is the ref url
https://codesandbox.io/s/react-rtk-with-graphql-9bl8q7
You are using a highly outdated style of Redux here that will make you write 4 times the code at no benefit - modern Redux does not have ACTION_TYPE constants, switch..case reducers, hand-written middleware (at least in a case like yours), immutable reducer logic or hand-written action creators - all that since 2019. The tutorial you are following is highly outdated and the problems you are facing right now will not be problems for you if you go with the modern style.
Please do yourself a favor and go follow the official Redux tutorial. It also covers getting data from apis in chapters 5, 7 and 8.

Error processing tweet JSON in R function: missing value where TRUE/FALSE needed

I am using a function which takes a raw tweet JSON file as input and outputs the retweet cascades. Here is a part of the function:
if (api_version == 2) {
parse_tweet <- function(tweet, keep_text = F) {
tryCatch({
json_tweet <- jsonlite::fromJSON(tweet)
id <- json_tweet$data$id
magnitude <-zero_if_null(json_tweet$includes$users$public_metrics$followers_count)
user_id <- json_tweet$data$author_id
retweet_id <- NA
if (keep_text) text <- json_tweet$data$text
#if this tweet is a retweet, get original tweet's information
if (!is.null(json_tweet$data$referenced_tweets) && json_tweet$data$referenced_tweets$type == 'retweeted') {
retweet_id <- json_tweet$data$referenced_tweets$id
cat("retweet_id: ", retweet_id, "\n")
if (keep_text) text <- NA
}
},
.... # warning for error processing json
)
}
}
Here is the error:
Error processing json: Error in if
(!is.null(json_tweet$data$referenced_tweets) &&
json_tweet$data$referenced_tweets$type == : missing value where
TRUE/FALSE needed
I checked my json file to see the path to find the type of tweet (e.g., "retweeted", "quoted", or "replied_to") which are in this path: json_tweet-> data -> referenced_tweets -> type) but I don't know why the function returns missing values and null retweet ids.
Here is a small part of the data (I couldn't upload even the first line of my json file because it exceeded the Stack Overflow character limits):
{"data": [{"referenced_tweets": [{"type": "retweeted", "id": "1253739069273710594"}], "entities": {"mentions": [{"start": 3, "end": 16, "username": "warriors_mom", "id": "75184478"}, {"start": 18, "end": 24, "username": "AC360", "id": "227837742"}], "annotations": [{"start": 25, "end": 39, "probability": 0.7096, "type": "Person", "normalized_text": "President Trump"}], "urls": [{"start": 98, "end": 121, "url": "", "images": [{"url": "", "width": 144, "height": 144}, {"url": "", "width": 144, "height": 144}], "status": 200, "title": "Ultraviolet Irradiation of Blood: \u201cThe Cure That Time Forgot\u201d?", "description": "Ultraviolet blood irradiation (UBI) was extensively used in the 1940s and 1950s to treat many diseases including septicemia, pneumonia, tuberculosis, arthritis, asthma and even poliomyelitis. The early studies were carried out by several physicians in ...", "unwound_url": ""}]}, "public_metrics": {"retweet_count": 3, "reply_count": 0, "like_count": 0, "quote_count": 0}, "possibly_sensitive": false, "reply_settings": "everyone", "lang": "en", "id": "1253834847258370048", "context_annotations": [{"domain": {"id": "3", "name": "TV Shows", "description": "Television shows from around the world"}, "entity": {"id": "10000271509", "name": "Anderson Cooper 360", "description": "Anderson Cooper goes beyond the headlines with in-depth reporting and investigations."}}, {"domain": {"id": "4", "name": "TV Episodes", "description": "Television show episodes"}, "entity": {"id": "1249271407508242432", "name": "Anderson Cooper 360", "description": "Anderson Cooper goes beyond the headlines with in-depth reporting and investigations. Through nightly \"Keeping Them Honest\" reports, Anderson keeps his commitment to holding those in power accountable."}}, {"domain": {"id": "4", "name": "TV Episodes", "description": "Television show episodes"}, "entity": {"id": "1249277031881138178", "name": "Anderson Cooper 360", "description": "Anderson Cooper goes beyond the headlines with in-depth reporting and investigations. Through nightly \"Keeping Them Honest\" reports, Anderson keeps his commitment to holding those in power accountable"}}, {"domain": {"id": "4", "name": "TV Episodes", "description": "Television show episodes"}, "entity": {"id": "1250891078401552385", "name": "Anderson Cooper 360", "description": "Anderson Cooper goes beyond the headlines with in-depth reporting and investigations. Through nightly \"Keeping Them Honest\" reports, Anderson keeps his commitment to holding those in power accountable."}}, {"domain": {"id": "10", "name": "Person", "description": "Named people in the world like Nelson Mandela"}, "entity": {"id": "799022225751871488", "name": "Donald Trump", "description": "45th US President, Donald Trump"}}, {"domain": {"id": "29", "name": "Events [Entity Service]", "description": "Entity Service related Events domain"}, "entity": {"id": "1249271407508242432", "name": "Anderson Cooper 360", "description": "Anderson Cooper goes beyond the headlines with in-depth reporting and investigations. Through nightly \"Keeping Them Honest\" reports, Anderson keeps his commitment to holding those in power accountable. And, of course, there's the RidicuList, a tongue-in-cheek commentary on the day's news that may leave viewers (and Anderson) laughing. Joining him are guests that frequently include political and legal analysts."}}, {"domain": {"id": "29", "name": "Events [Entity Service]", "description": "Entity Service related Events domain"}, "entity": {"id": "1249277031881138178", "name": "Anderson Cooper 360", "description": "Anderson Cooper goes beyond the headlines with in-depth reporting and investigations. Through nightly \"Keeping Them Honest\" reports, Anderson keeps his commitment to holding those in power accountable. And, of course, there's the RidicuList, a tongue-in-cheek commentary on the day's news that may leave viewers (and Anderson) laughing. Joining him are guests that frequently include political and legal analysts."}}, {"domain": {"id": "29", "name": "Events [Entity Service]", "description": "Entity Service related Events domain"}, "entity": {"id": "1250891078401552385", "name": "Anderson Cooper 360", "description": "Anderson Cooper goes beyond the headlines with in-depth reporting and investigations. Through nightly \"Keeping Them Honest\" reports, Anderson keeps his commitment to holding those in power accountable. And, of course, there's the RidicuList, a tongue-in-cheek commentary on the day's news that may leave viewers (and Anderson) laughing. Joining him are guests that frequently include political and legal analysts."}}, {"domain": {"id": "35", "name": "Politician", "description": "Politicians in the world, like Joe Biden"}, "entity": {"id": "799022225751871488", "name": "Donald Trump", "description": "45th US President, Donald Trump"}}], "created_at": "2020-04-24T23:54:57.000Z", "author_id": "1890848160", "text": "RT #warriors_mom: #AC360 President Trump was referring to this well-documented medical treatment: ", "source": "Twitter for iPhone", "conversation_id": "1253834847258370048"}, {"referenced_tweets": [{"type": "retweeted", "id": "1253452455540666371"}], "entities": {"mentions": [{"start": 3, "end": 16, "username": "warriors_mom", "id": "75184478"}], "annotations": [{"start": 24, "end": 27, "probability": 0.691, "type": "Place", "normalized_text": "U.S."}]}, "public_metrics": {"retweet_count": 5, "reply_count": 0, "like_count": 0, "quote_count": 0}, "possibly_sensitive": false, "reply_settings": "everyone", "lang": "en", "id": "1253828982413410307", "context_annotations": [{"domain": {"id": "123", "name": "Ongoing News Story", "description": "Ongoing News Stories like 'Brexit'"}, "entity": {"id": "1220701888179359745", "name": "COVID-19"}}], "created_at": "2020-04-24T23:31:39.000Z", "author_id": "863857568", "text": "RT #warriors_mom: Major U.S. credit-card issuers begin lowering customer spending limits as coronavirus pandemic shutdowns leave millions j\u2026", "source": "Twitter for iPhone", "conversation_id": "1253828982413410307"}, {"referenced_tweets": [{"type": "retweeted", "id": "1253815956662620163"}],"entities":.... }}
I found some similar questions, but none of the answers helped me.
Looking at the JSON, referenced_tweets is an array (it has square brackets around its value: "referenced_tweets":[{"type": "retweeted", "id": "1253739069273710594"}]).
So the cause of the error is json_tweet$data$referenced_tweets$type doesn't exist - type is a property of each of the elements of the array, not the array itself.
So you'll need to loop over the array. Something like this, based on your original code:
#if this tweet is a retweet, get original tweet's information
if (!is.null(json_tweet$data$referenced_tweets)) {
for (i in seq_along(json_tweet$data$referenced_tweets)) {
referenced_tweet <- json_tweet$data$referenced_tweets[[i]]
if (referenced_tweet$type == 'retweeted') {
cat("retweet_id: ", referenced_tweet$id, "\n")
if (keep_text) text <- NA
}
}
}
You probably don't need the if (!is.null...) as I think seq_along will handle the null case, but you might want to leave it for readability.

How to Download JSON Data Files Using API from Census Bureau

I'm trying to use R to download the International Trade data from the Census Bureau. They provide an API which returns JSON data like the following example. I'm not familiar with APIs and JSON. How can I query the API through R?
{
"#context": "https://project-open-data.cio.gov/v1.1/schema/catalog.jsonld",
"#id": "https://api.census.gov/data/timeseries/eits/ftd.json",
"#type": "dcat:Catalog",
"conformsTo": "https://project-open-data.cio.gov/v1.1/schema",
"describedBy": "https://project-open-data.cio.gov/v1.1/schema/catalog.json",
"dataset": [
{
"c_dataset": [
"timeseries",
"eits",
"ftd"
],
"c_geographyLink": "https://api.census.gov/data/timeseries/eits/ftd/geography.json",
"c_variablesLink": "https://api.census.gov/data/timeseries/eits/ftd/variables.json",
"c_examplesLink": "https://api.census.gov/data/timeseries/eits/ftd/examples.json",
"c_groupsLink": "https://api.census.gov/data/timeseries/eits/ftd/groups.json",
"c_valuesLink": "https://api.census.gov/data/timeseries/eits/ftd/values.json",
"c_documentationLink": "http://www.census.gov/developer/",
"c_isTimeseries": true,
"c_isCube": true,
"c_isAvailable": true,
"#type": "dcat:Dataset",
"title": "Time Series Economic Indicators Time Series -: U.S. International Trade in Goods and Services",
"accessLevel": "public",
"bureauCode": [
"006:07"
],
"description": "The U.S. Census Bureau.s economic indicator surveys provide monthly and quarterly data that are timely, reliable, and offer comprehensive measures of the U.S. economy. These surveys produce a variety of statistics covering construction, housing, international trade, retail trade, wholesale trade, services and manufacturing. The survey data provide measures of economic activity that allow analysis of economic performance and inform business investment and policy decisions. Other data included, which are not considered principal economic indicators, are the Quarterly Summary of State & Local Taxes, Quarterly Survey of Public Pensions, and the Manufactured Homes Survey. For information on the reliability and use of the data, including important notes on estimation and sampling variance, seasonal adjustment, measures of sampling variability, and other information pertinent to the economic indicators, visit the individual programs' webpages - http://www.census.gov/cgi-bin/briefroom/BriefRm.",
"distribution": [
{
"#type": "dcat:Distribution",
"accessURL": "https://api.census.gov/data/timeseries/eits/ftd",
"description": "API endpoint",
"format": "API",
"mediaType": "application/json",
"title": "API endpoint"
}
],
"contactPoint": {
"fn": "Economic Indicators Mail List",
"hasEmail": "econ.indicators#census.gov"
},
"identifier": "http://api.census.gov/data/id/EITSFTD",
"keyword": [
],
"license": "http://creativecommons.org/publicdomain/zero/1.0/Public Domain",
"modified": "2017-02-23",
"programCode": [
"006:007"
],
"references": [
"http://www.census.gov/developers/"
],
"spatial": "United States",
"temporal": "January 1992 - Current",
"publisher": {
"#type": "org:Organization",
"name": "U.S. Census Bureau",
"subOrganizationOf": {
"#type": "org:Organization",
"name": "U.S. Department Of Commerce",
"subOrganizationOf": {
"#type": "org:Organization",
"name": "U.S. Government"
}
}
}
}
]
}
More details: the API's can be found here: https://www.census.gov/data/developers/data-sets/international-trade.html
the data can be manually downloaded from here with log-in required: https://usatrade.census.gov/
The easiest way would be, to send a GET request to the API by using httr::GET(). The URL below is taken from their examples. You can modify the URL parameters (e.g. change year=2013 to year=2000) to retrieve different results. Lastly, I use data.table::rbindlist() to bind the nested list into a data.table/data.frame object.
require(httr)
require(data.table)
url = "https://api.census.gov/data/timeseries/intltrade/exports/hs?get=DISTRICT,DIST_NAME,E_COMMODITY,E_COMMODITY_LDESC,ALL_VAL_MO,ALL_VAL_YR,VES_VAL_MO,VES_VAL_YR&YEAR=2013&MONTH=12&DISTRICT=13"
res = GET(url)
cont = content(res) # parses the API result (recognizes JSON)
dat = rbindlist(cont)
You can have a look here, for how to work with APIs in R.

phone number in json foursquare api

i have a json returned from foursquare to get the nearby gym i just wanna know if it may return several phone numbers for the same gym and if it is the case i need to know the format of the numbers... are they separated by "," or being displayed in several tags?
"categories": [
{
"id": "4bf58dd8d48988d16e941735",
"name": "Fast Food Restaurant",
"pluralName": "Fast Food Restaurants",
"shortName": "Fast Food",
"icon": {
"prefix": "https://ss1.4sqi.net/img/categories_v2/food/fastfood_",
"suffix": ".png"
},
"primary": true
}
]
There is only one phone number associated with each venue. You can find phone and formattedPhone responses in the contact field for a venue. Example: https://developer.foursquare.com/docs/explore#req=venues/4be30f9dd27a20a1cd1f915b

freebase - topic description/articles

I'm trying to retrieve the topic description for some film ("/film/film") and film genres ("film/film_genre") in italian language.
I think the problem is the same in both cases, so I post the MQL query that I'm trying to run for the film genre description:
Mql query
[{
"type": "/film/film_genre",
"name": "Film culto",
"/common/topic/article": [{
"id": null
}]
}]
Response
{
"result": [{
"type": "/film/film_genre",
"name": "Film culto",
"/common/topic/article": [{
"id": "/m/01q0d"
}]
}]
}
With the article ID received ("/m/01q0d"), I would use the "trans/wrap" service (http://api.freebase.com/api/trans/raw/m/01q0d). However, even though I use the query parameter "lang=it", the article is in English... :(
Any suggestions? I'm going crazy :D
Freebase contains non-English names, but it doesn't, for the most part, contain descriptions in anything other than English. You could use the Topic API and get the /common/topic/topic_equivalent_webpage for the Italian Wikipedia to fetch the article/description from there, but that's probably the closest you'll get.
https://www.googleapis.com/freebase/v1/topic/m/01q03
And, as Phil said, the api.freebase.com is going away in a matter of days, so you need to be using the new APIs.

Resources