Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

How to get data from an external source?

Started by Muut Archive 9 years ago · 2 replies · 1246 views
9 years ago

Hi all,

I am loving the look and feel of Grav thus far, and am learning by doing...
I am trying to create a page with data loaded from an external source, namely:
The Calendar feed from the Sonarr API endpoint: https://github.com/Sonarr/Sonarr/wiki/Calendar

But I am at a total loss as how I can acomplish this... Is this something that can be
achived with a flat file CMS such as Grav?

Hopefully someone much smarter than me can answer this easily!
Your help is appreciated!!!

Cheers!

9 years ago

It certainly is possible, but it will require a little custom work in the form of a plugin. You can see a good example with the TwigFeeds plugin that is pulling feed data, and making it available in Twig to output as you need: https://github.com/olevik/grav-plugin-twigfeeds

You would need to create a similar plugin that could access a remote JSON feed as your Sonarr API provides, and then parses that into a PHP object, and sets that on a Twig variable. This is pretty simple stuff actually.

9 years ago

If you don't feel up to the task, contact us via http://trilby.media and we'll can discuss development of a custom plugin to do what you need. Cheers.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1346 9 years ago
Archive · by Muut Archive, 9 years ago
2 933 9 years ago
Archive · by Muut Archive, 9 years ago
2 4060 9 years ago
Archive · by Muut Archive, 9 years ago
1 2945 9 years ago
Archive · by Muut Archive, 9 years ago
3 1117 9 years ago