Coding Help?

For Joomla! 2.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
Note: All 1.6, 1.7 and 3.5 releases have reached end of life and should be updated to 3.x.

Moderator: ooffick

Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
Locked
coopaman
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Fri Oct 24, 2014 8:53 pm

Coding Help?

Post by coopaman » Fri Oct 24, 2014 9:30 pm

I want to be able to display the information from a remote url:-

https://api.kixeye.com/api/v2/online-player-count

{
"totalPlayersOnline": 98688
}

Inside a Module but formatted with html to look like this

http://prntscr.com/4ze7ur

I've been reading various articles and not really sure were to start, can anyone point me in the right direction?
Last edited by imanickam on Sat Oct 25, 2014 2:53 am, edited 1 time in total.
Reason: Moved the topic from the forum General Questions/New to Joomla! 2.5 to the forum Joomla! 2.5 Coding

coding1
I've been banned!
Posts: 340
Joined: Mon Oct 20, 2014 10:42 am

Re: Coding Help?

Post by coding1 » Sat Oct 25, 2014 5:01 am

get value from your url and display in one module. You should build one module to display.

User avatar
pe7er
Joomla! Master
Joomla! Master
Posts: 24974
Joined: Thu Aug 18, 2005 8:55 pm
Location: Nijmegen, Netherlands
Contact:

Re: Coding Help?

Post by pe7er » Sat Oct 25, 2014 9:07 am

Create a Module and use curl or allow_url_fopen to retrieve the page,
and use json_decode to convert the JSON style data to a variable that you display on the screen.
http://php.net/manual/en/function.json-decode.php

I used that to retrieve more complex JSON data in a Joomla 3 module, see: https://github.com/pe7er/db8kivateam
Kind Regards,
Peter Martin, Global Moderator
Company website: https://db8.nl/en/ - Joomla specialist, Nijmegen, Netherlands
The best website: https://the-best-website.com


Locked

Return to “Joomla! 2.5 Coding”