Support » Plugin: JSON Content Importer » Content from newsapi.org

  • Resolved Geetar

    (@geetar)



    Hello,

    I’m pretty new with JSON and I can’t get this plugin to work with newsapi.org.

    I’m unsure if it’s the right way but I’ve added the following URL to a post:

    [jsoncontentimporter url=https://newsapi.org/v2/top-headlines?country=us&category=business&apiKey=API_KEY[/jsoncontentimporter] (where API_KEY my API key)

    But unfortunately it doesn’t work. I don’t know if it is the theme or I’m doing it wrong.

    What is the correct way to implement this feed?

    Thanks in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author berkux

    (@berkux)

    Hi,

    see
    http://wptest.kux.de/newsapi-org/
    done with

    [jsoncontentimporter url=https://newsapi.org/v2/top-headlines?country=us&category=business&apiKey=KEY DEAKdebugmode=10]
    totalResults: {totalResults}
    {subloop-array:articles:-1}
    <img src={urlToImage} width=100 align=left><b>{articles.title}</b><br>{description} <a href={url} target=_blank>more</a><br clear=all>
    {/subloop-array:articles}
    [/jsoncontentimporter] 

    If you want to format the time & date you need the pro-version.

    Bernhard

    • This reply was modified 1 year ago by  berkux.
    Geetar

    (@geetar)

    Hi berkux,

    Thanks for your help!

    I’ll try it.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Content from newsapi.org’ is closed to new replies.