Guild News feed example?

100 Draenei Shaman
10730
Their file works on our server, so this has really got me stumped.

This is from their server:

json support enabled
json version 1.2.1
Reply Quote
93 Draenei Paladin
13695
yea on my server i cant use file gets but curl works fine
Reply Quote
100 Draenei Shaman
10730
How would I do the following with curl?

$api_guild_news_url = "http://us.battle.net/api/wow/guild/Elune/Damnation?
fields=news";

$file_contents = @file_get_contents($api_guild_news_url);

$guildNews = json_decode($file_contents, true);
Edited by Dnul on 9/16/2012 6:10 PM PDT
Reply Quote
93 Draenei Paladin
13695
$api_guild_news_url = "http://us.battle.net/api/wow/guild/Elune/Damnation?
fields=news";

$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $api_guild_news_url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.2) Gecko/20070319 Firefox/2.0.0.3");
$file_contents = curl_exec($ch);
curl_close($ch);

$guildNews = json_decode($file_contents, true);
Reply Quote
100 Draenei Shaman
10730
Awesome, ty :)
Reply Quote
100 Draenei Shaman
10730
Ok, how do you rip up the timestamp to something more readable?
Reply Quote
100 Night Elf Hunter
13825
$date = date("M d Y H:i:s", apitimestamp);
Reply Quote
100 Draenei Shaman
10730
Ok, I am fine if the apitimestamp and the time() is > 23:59 hours, but I am not sure how I calculate this if apitimestamp say = 22:00 the day before and the time is now 22:00.

We are not using a database if that makes a difference.
Edited by Dnul on 9/18/2012 9:19 AM PDT
Reply Quote
100 Draenei Shaman
10730
When I do the following, the timestamp in the api call is 1 hour ahead....what causes this?

$time = date("M d Y H:i:s", time());
$date = date("M d Y H:i:s", $news['timestamp']/1000);

TIME: Sep 18 2012 22:11:52
DATE: Sep 18 2012 23:07:00
Reply Quote
100 Night Elf Hunter
13825
your server is probaby in a diff time zone my realm is 3 hours behind me
Reply Quote
90 Goblin Warlock
8825
I use invision power board however I am able to input custom blocks of code so any output could be possible. Guess to make it simple I'm just looking for a php file that is easy to configure and outputs the news similar to the way blizzard does on our guilds armory page. I already have the wowhead tooltip js in place, which makes linking items ect simple.

EDIT: Upon reviewing the thread and previous posts the source posted previously is exactly what I was looking for. With a little bit of raw editing to match my current theme it will work perfect as an iframe. Thanks so much!
Edited by Gëëk on 10/7/2012 6:26 AM PDT
Reply Quote
100 Human Mage
12845
For WordPress possibly?
Reply Quote
90 Pandaren Rogue
19135
Does anyone have something like this for enjin? Ty
Reply Quote
100 Night Elf Hunter
13825
i dont know if they have the ability to allow use of json .. but if something was writen is js you could create a html block...
Reply Quote
90 Pandaren Rogue
19135
oh ty Ulminia, that is good news. I suppose I should ask, can anyone write this for my site? If it truly is as simple as putting a snippet of code into an html block then I am very happy =)
Edited by Isobel on 5/3/2013 4:18 PM PDT
Reply Quote
100 Night Elf Hunter
13825
html/java only tho they will not allow php code

you could
use 3rd party hosting to gen a list have java get the pages contents and load them in to the html div frame ... just an idea
Reply Quote
09/14/2012 12:13 PMPosted by Zonous
09/14/2012 06:00 AMPosted by Gëëk
I have a guild site and would like the news feed so i can place it in a side box.


what platform do you use for you site maybe i can make a mod for your site and any one else that wants it .. as long as its not joomla..


I'm looking to incorporate the guild news weekly contributors and guild professions into my guilds website hosted on enjin I tried following the forums here and I just get lost. If your still willing to lend a hand love to talk with you
Reply Quote
100 Night Elf Hunter
13825
sure i can help you out hit me up this chars name at gmail (im zonous as well lol)
Reply Quote

Please report any Code of Conduct violations, including:

Threats of violence. We take these seriously and will alert the proper authorities.

Posts containing personal information about other players. This includes physical addresses, e-mail addresses, phone numbers, and inappropriate photos and/or videos.

Harassing or discriminatory language. This will not be tolerated.

Forums Code of Conduct

Report Post # written by

Reason
Explain (256 characters max)

Reported!

[Close]