WordPress.org

Forums

JSON Data Shortcode
[resolved] Doesn't pull in json data to page/post (8 posts)

  1. headspin
    Member
    Posted 2 years ago #

    I'm trying to pull in json data from another test domain via it's api (I have access to debug this api). The API gets called on the save of the post w/the shortcode in it but not on a page refresh and no json data is shown on page.

    http://wordpress.org/extend/plugins/json-data-shortcode/

  2. David Dean
    Member
    Plugin Author

    Posted 2 years ago #

    JSON data is cached according to the "lifetime" param, or 30 minutes by default. Have you waited long enough for the data to expire?

  3. davebos
    Member
    Posted 2 years ago #

    David,

    Does the shortcode still work with version 3.4?

    I can't get the shortcode to output anything on my site. Will it return an error or just stay blank if it doesn't find the key? I am not sure that I am formating the key correctly. Can you give me a sample of properly formatted shortcode with a live json feed?

    Thanks!!!

  4. David Dean
    Member
    Plugin Author

    Posted 2 years ago #

    Hi davebos,

    The shortcode is working for me on 3.4.2. The shortcode doesn't output anything if the key isn't found, but you can see any errors by enabling debugging in WP.

    Here's the code I use to test:

    [json src="http://developer.yahooapis.com/TimeService/V1/getTime?appid=YahooDemo&output=json" lifetime="30"]At the tone, the time will be: {Result.Timestamp}[/json]

    Let me know whether that works on your install!

    - David

  5. bakedbeing
    Member
    Posted 2 years ago #

    Hiya David, I installed 3.4.2 on my localhost, then installed your plugin manually, and it shows up fine in my plugins panel. It also shows the correct description.

    I've tried dropping in your exact code from the post above (the yahoo timeservice) and nothing shows up for the timestamp. I've plugged the src url into a browser and the Yahoo service appears to be fine. Any ideas what might be happening?

    Thanks mate!

  6. bakedbeing
    Member
    Posted 2 years ago #

    Hi again, sorry for the trouble! A bit more info: I've turned on wordpress debugging and it's telling me the selected key can't be found. I've tried Result by itself and Timestamp, but no dice. I've also tried it with a feed on Petrescue and I can't pull the data out of the results there either.

    Thanks!

  7. David Dean
    Member
    Plugin Author

    Posted 2 years ago #

    Hi bakedbeing -

    Thanks for reporting this!

    I see what you mean. I have a couple test environments and I'm able to reproduce this problem on one of them. Let me take a look and see what I can find.

    - David

  8. David Dean
    Member
    Plugin Author

    Posted 2 years ago #

    Hi @bakedbeing -

    If you copy and paste the above code, make sure the ampersand isn't being escaped. I'll be releasing a new version shortly that will take care of this on the fly.

    Thanks for reporting this issue!

    - David

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • JSON Data Shortcode
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags