JSON & Links

0 views
Skip to first unread message

Jesse Sutherland

unread,
Aug 9, 2010, 3:41:15 PM8/9/10
to UNL Event Publisher
Hi, I was wondering if there was a chance that JSON formatted output
would be included in addition to RSS/XML etc? I'm working on a front-
end widget for a site that uses UNL and JSON is by far the easiest
data format to use with JS and JQuery in particular.

I've created a proxy php file to grab the results in XML and then
convert it to JSON and this works fine & the code could be added to
the project probably quite easily.

The other request/query is that when I view the upcoming events in XML/
RSS the WebPages -> WebPage -> URL value is empty a fair bit of the
time. Is this value automatically generated? And if not, how can I
use the other data for a given event to generate a relevant URL for
it? I noticed that the HTML output for upcoming events always does
have a properly formatted link. I imagine there's some parsing I
might have to do or some pattern to pickup on to generate said link.
Thanks for your help! - Jesse

mdmcginn

unread,
Aug 9, 2010, 6:10:57 PM8/9/10
to UNL Event Publisher
Hi Jesse,

You manually paste in the Event Webpage in the Event Manager to
populate the URL value. The field becomes visible when you "Click to
add additional details". One of the most overlooked yet most useful
fields in the UNL calendar. The Location Webpage is entered when the
location is first created.

--
Michael D. McGinnis
Web Communications Specialist
Division of Marketing and Communications
Texas A&M University
mdmcg...@tamu.edu

1372 TAMU | College Station, TX 77843-1372
Tel. 979.458.0677
http://www.tamu.edu/


On Aug 9, 2:41 pm, Jesse Sutherland <jesse.a.sutherl...@gmail.com>
wrote:

Brett Bieber

unread,
Aug 9, 2010, 6:45:24 PM8/9/10
to unl-event...@googlegroups.com
On Mon, Aug 9, 2010 at 2:41 PM, Jesse Sutherland
<jesse.a.s...@gmail.com> wrote:
> Hi, I was wondering if there was a chance that JSON formatted output
> would be included in addition to RSS/XML etc?  I'm working on a front-
> end widget for a site that uses UNL and JSON is by far the easiest
> data format to use with JS and JQuery in particular.
>
> I've created a proxy php file to grab the results in XML and then
> convert it to JSON and this works fine & the code could be added to
> the project probably quite easily.

This would be a great addition. All that is needed is _json.tpl.php
files within the frontend. View the files here to get an idea of how
this works for the xml, rss, and icalendar output formats:
http://code.google.com/p/unl-event-publisher/source/browse/#svn/UNL_UCBCN_Frontend/trunk/www/templates/default

A patch attached to a bug report would be great.

> The other request/query is that when I view the upcoming events in XML/
> RSS the WebPages -> WebPage -> URL value is empty a fair bit of the
> time.  Is this value automatically generated? And if not, how can I
> use the other data for a given event to generate a relevant URL for
> it?  I noticed that the HTML output for upcoming events always does
> have a properly formatted link.  I imagine there's some parsing I
> might have to do or some pattern to pickup on to generate said link.

As Michael stated, the web page url is submitted by the person
creating the event. All 'permalinks' to event instances follow a
simple scheme:
http://events.unl.edu/2010/06/07/48769/

Where the last number is the eventdatetime ID. The event ID is
separate as one event can have multiple dates & times.

Hope that helps.

> Thanks for your help! - Jesse


--
Brett Bieber
University of Nebraska-Lincoln

Reply all
Reply to author
Forward
0 new messages