Team-4-PennBootcamp / Project-1

https://team-4-pennbootcamp.github.io/Project-1/
MIT License
0 stars 2 forks source link

NewsAPI Integration #4

Closed ftorning closed 6 years ago

kevnat commented 6 years ago

Your API key is: efb42eaae6b94bce83b1568d1127f897

kevnat commented 6 years ago
GET /v2/top-headlines?pageSize=20&apiKey=efb42eaae6b94bce83b1568d1127f897&sources=cnn,fox-news,the-huffington-post,bbc-news,breitbart-news,vice-news&q=trump HTTP/1.1
Host: newsapi.org
Cache-Control: no-cache
Postman-Token: 73eb4cb5-970c-459d-ad6a-a5a46f6f7c3b
Body:
{
    "status": "ok",
    "totalResults": 11,
    "articles": [
        {
            "source": {
                "id": "fox-news",
                "name": "Fox News"
            },
            "author": "Fox News",
            "title": "Sarah Sanders says she was thrown out of Virginia restaurant because she works for Trump",
            "description": "White House Press Secretary Sanders was thrown out of a Virginia restaurant on Friday because she works for President Trump -- the latest Trump official to be hounded out of a restaurant because of their political affiliation.",
            "url": "http://www.foxnews.com/politics/2018/06/23/sarah-sanders-says-was-thrown-out-virginia-restaurant-because-works-for-trump.html",
            "urlToImage": "http://a57.foxnews.com/media2.foxnews.com/BrightCove/694940094001/2018/06/14/0/0/694940094001_5797603675001_5797599123001-vs.jpg?ve=1",
            "publishedAt": "2018-06-23T16:18:00+00:00"
        },
        {
            "source": {
                "id": "cnn",
                "name": "CNN"
            },
            "author": null,
            "title": "Anchor fact-checks Trump supporter on separations - CNN Video",
            "description": "What began as a new Trump administration policy, enacted in mid-April, has turned to a crisis that resulted in the separation of immigrant children from their parents. CNN's Victor Blackwell discusses the decisions that lead to the policy.",
            "url": "http://us.cnn.com/videos/politics/2018/06/23/separations-fact-check-amy-kremer-blackwell-new-day-weekend.cnn",
            "urlToImage": "https://cdn.cnn.com/cnnnext/dam/assets/180623102523-amy-kremer-on-new-day-super-tease.jpg",
            "publishedAt": "2018-06-23T15:08:08.6013805Z"
        },
        {
            "source": {
                "id": "fox-news",
                "name": "Fox News"
            },
            "author": "Fox News",
            "title": "'Angel families' discuss meeting with President Trump",
            "description": "President Trump met with families who have lost loved ones do to crimes by illegal immigrants; details on 'Fox & Friends.'",
            "url": "http://video.foxnews.com/v/5801023160001/",
            "urlToImage": "http://a57.foxnews.com/media2.foxnews.com/BrightCove/694940094001/2018/06/23/640/360/694940094001_5801020580001_5801023160001-vs.jpg",
            "publishedAt": "2018-06-23T13:38:03.6699616Z"
        },
        {
            "source": {
                "id": "cnn",
                "name": "CNN"
            },
            "author": "Kevin Liptak, CNN",
            "title": "Trump's go-it-alone immigration strategy ends in chaos",
            "description": "On Wednesday morning, White House cooks were flipping steaks and unboxing popcorn machines ahead of the yearly congressional picnic. Within the hour, the picnic was scrubbed, the steaks on ice, and the popcorn machines trucked away.",
            "url": "http://us.cnn.com/2018/06/23/politics/donald-trump-immigration-week-chaos/index.html",
            "urlToImage": "https://cdn.cnn.com/cnnnext/dam/assets/170430145357-trump-media-super-tease.jpg",
            "publishedAt": "2018-06-23T12:33:12Z"
        },
        {
            "source": {
                "id": "cnn",
                "name": "CNN"
            },
            "author": "Marshall Cohen and Austen Bundy",
            "title": "Trump's personal legal team opposed family separation",
            "description": "Two of President Donald Trump's personal lawyers on the Russia investigation broke ranks with their client this week on an entirely unrelated topic, rejecting his now-abandoned practice of separating undocumented immigrant families at the border.",
            "url": "http://us.cnn.com/2018/06/23/politics/trump-lawyers-immigration-opposition/index.html",
            "urlToImage": "https://cdn.cnn.com/cnnnext/dam/assets/180622160049-sekulow-giuliani-split-super-tease.jpg",
            "publishedAt": "2018-06-23T12:27:00Z"
        },
        {
            "source": {
                "id": "the-huffington-post",
                "name": "The Huffington Post"
            },
            "author": "Arthur Delaney",
            "title": "This Bartender Got Fired For Being Rude To Trump Supporters. He Doesn't Regret It.",
            "description": "Tommy Ewing-Brown initially refused to serve a group of Trump supporters a week before the election.",
            "url": "https://www.huffingtonpost.com/entry/bartender-fired-trump-supporters_us_5b2d5d02e4b0040e2742dce0",
            "urlToImage": "https://img.huffingtonpost.com/asset/5b2d6c172000004100b9533b.jpeg?cache=ifpLBR6rfS&ops=1200_630",
            "publishedAt": "2018-06-23T12:00:25Z"
        },
        {
            "source": {
                "id": "breitbart-news",
                "name": "Breitbart News"
            },
            "author": null,
            "title": "Marvel Director James Gunn: Trump ‘Wakes Up Every Morning Hoping More Kids Are Murdered By Immigrants’",
            "description": "Marvel director James Gunn has claimed that President Donald Trump secretly hopes for the murder of American citizens at the hands of illegal immigrants to help boost his popularity.",
            "url": "http://www.breitbart.com/big-hollywood/2018/06/23/marvel-director-james-gunn-trump-wakes-up-every-morning-hoping-more-kids-are-murdered-by-immigrants/",
            "urlToImage": "http://media.breitbart.com/media/2018/01/Gunn1.jpg",
            "publishedAt": "2018-06-23T07:19:23Z"
        },
        {
            "source": {
                "id": "the-huffington-post",
                "name": "The Huffington Post"
            },
            "author": "Elise Foley, Jennifer Bendery",
            "title": "This Alternative To Detaining Immigrant Families Works. Trump Just Won't Use It.",
            "description": "There are much better options than taking kids from their parents or locking them up together.",
            "url": "https://www.huffingtonpost.com/entry/trump-family-detention-alternative_us_5b2d4731e4b0321a01d1002e",
            "urlToImage": "https://img.huffingtonpost.com/asset/5b2d47772200006a03eec4c7.jpeg?cache=vn0u4nnxb4&ops=1910_1000",
            "publishedAt": "2018-06-22T21:54:37Z"
        },
        {
            "source": {
                "id": "the-huffington-post",
                "name": "The Huffington Post"
            },
            "author": "Ariel Edwards-Levy",
            "title": "More Americans Blame Undocumented Parents Than Trump For Family Separations",
            "description": "The White House has managed to dodge a lot of blame for a deeply unpopular policy.",
            "url": "https://www.huffingtonpost.com/entry/americans-blame-undocumented-parents-trump-family-separations_us_5b2d4bc3e4b0040e2742cc90",
            "urlToImage": "https://img.huffingtonpost.com/asset/5b2d6f7d1a0000cd04ce262c.jpeg?cache=bgEggGfHCx&ops=1200_630",
            "publishedAt": "2018-06-22T21:54:14Z"
        },
        {
            "source": {
                "id": "bbc-news",
                "name": "BBC News"
            },
            "author": "BBC News",
            "title": "Trump highlights victims of migrants",
            "description": "Mr Trump has faced worldwide backlash over the US policy of separating migrant children and parents.",
            "url": "http://www.bbc.co.uk/news/world-us-canada-44580964",
            "urlToImage": "https://ichef.bbci.co.uk/news/1024/branded_news/8512/production/_102166043_tv047651585.jpg",
            "publishedAt": "2018-06-22T20:40:40Z"
        },
        {
            "source": {
                "id": "breitbart-news",
                "name": "Breitbart News"
            },
            "author": null,
            "title": "Mueller Prosecutors: Paul Manafort Can't Argue Our Charges Are Related to 2016 Campaign",
            "description": "Prosecutors for special counsel Robert Mueller asked a federal court Friday to bar the defense for Paul Manafort from arguing charges against their client were brought because of his role in Donald Trump’s 2016 presidential campaign.",
            "url": "http://www.breitbart.com/big-government/2018/06/22/mueller-prosecutors-paul-manafort-cant-argue-our-charges-are-related-to-2016-campaign/",
            "urlToImage": "http://media.breitbart.com/media/2018/06/paul-manafort-robert-mueller-ap.jpg",
            "publishedAt": "2018-06-22T14:11:31Z"
        }
    ]
}
kevnat commented 6 years ago

Instead of one request to many sources, create multiple requests to specific sources. "top headlines" sources: cnn, fox-news, the-huffington-post ,bbc-news ,breitbart-news ,vice-news, reuters, politico, the-washington-post, msnbc pagesize: 5

ftorning commented 6 years ago

This is working as intended - closing this issue