Tags

The Wellynews API


Word cloud by Wordle

A number of large news organisations have begun providing APIs to their content. These services allow content to be queried programmatically for use in mash ups and the like.

The Wellynews API lets you do something simular with the local newsitems indexed by Search Wellington.

For example, the API can provide a feed of local newsitems related to consultation; or maybe zebras. It can also handle potentially interesting combinations, such as what Wellington City Council has said about the Indoor Sports Centre or sculpture on the waterfront.

Getting started

Supported Formats

The API allows newsitems to be extracted in RSS or JSON (Javascript) formats. RSS is widely supported by feed readers, web browsers and server side libraries. JSON is typically used for passing data into browser based Javascript applications and mashups.

The desired format is specified by appending ethier rss or json to the end of the query url.

ie. Transport newsitems in RSS format:

or the same newsitems in JSON format:

Specifying tags and publishers

When querying for newsitems (below) you have the option of filtering by tag or publisher. Tags and publishers are specified by substituting the appropriate url snippet into your request.

ie. The url snippet for Wellington City Council is wellington-city-council.

A complete list of available tag and publisher url snippets is provided below.

Newsitem queries

The following types of newsitem query are supported.

Tag newitems

Returns newsitems tagged with a given tag.

ie. All newsitems tagged with soccer, in RSS format.

Publisher newsitems

Returns newsitems published by a specific publisher.

ie. newsitems published by the Capital Times, in JSON format.

Combinations

Returns newsitems tagged with a combination of two tags, or a publisher and a tag.

The tags are seperated with a plus character. For combinations involving a publisher, the publisher must always appear on the left hand side of the plus.

ie. newsitems tagged with transport and consultation and Wellington City Council media releases tagged with indoor sports centre.

Credit: The combination url scheme was inspired by the Guardian newspapers' tag combiners.

Commented newsitems

Returns newsitems which have been commented on.

ie. Commented newsitesm in JSON format.

Commented newsitems also specifiy the newsitems'comment feed url on the commentFeed field on the JSON results.

Commented newsitems for a tag

Returns commented newsitems for a given tag.

ie. Commented newsitems tagged with waterfront in JSON format.

Geotagged newsitems

Returns newsitems which have been geotagged.

ie. Geotagged newsitems in RSS format.

Pagination

Each RSS or JSON call returns a maximum of 30 results. For JSON calls, additional results can be obtained from using the page parameter to paginate through the results.

ie. page 6 of the Victoria University newsitems:

You can see the total number of available results in the totalItems field of the JSON results. The showingFrom and showingTo fields tell you which resuls you are currently viewing:


{
  "totalItems": 377,
  "showingFrom": 151,
  "showingTo": 180,
  "newsitems": [ ... ]
}

JSONP callbacks

You can specify that JSON results should be wrapped in a JSONP style callback, using the optional callback parameter. This is approch is required when making cross domain JSON calls from a web brower.

ie.

Your callback function name may contain letters, numbers and underscores only.

Geotagging

Where applicable, geotags are also embedded in our RSS feeds using the GeoRSS standard. A GeoRSS tagged feed item has this format:

<item>
<title>Can you replace the Hilton?</title>
<geo:lat>-41.284896</geo:lat>
<geo:long>174.778531</geo:long>
</item>

RSS to JSON feed mirroring

Provides JSON copies of local RSS feeds. This makes it easier to integrate feeds into sites using Javascript.

ie. Wellington City Councils' latest news feed as a JSON list:

A complete list of feed url snippets is provided below.

URL snippets

Available Tags
TagURL snippet
Accommodation accommodation
Animals animals
Architecture architecture
Art art
Blanket man blanket-man
Blogs blogs
Books books
Bus review bus-review
Business business
Busking busking
Cinema cinema
City Guides cityguides
Community Groups communitygroups
Conservation conservation
Education education
election2011 election2011
Elections 2010 elections2010
Emergency Services emergencyservices
Events events
Fashion fashion
Featured featured
Gay & Bisexual gaybisexual
Government government
Health health
Internet internet
Issues issues
Law law
Libraries libraries
Local History localhistory
Media media
Misc misc
MMA mma
Obituaries obituaries
Open data open-data
Performing Arts performingarts
Petone petone
Pies pies
Places places
Real Estate realestate
Restaurants and Bars restaurantsbars
Reviews reviews
Sausages sausages
Scraper required scraper-required
Snow snow
Sport sport
Tourism tourism
Transport transport
Tsunami tsunami
Video video
WCN Hosted wcnhosted
Webcams webcams
Wellington wellington
Zombies zombies
Available Publishers
PublisherURL snippet
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
$publisher.name $publisher.urlWords
Available RSS to JSON Feeds
FeedURL snippet
Adam Art Gallery feed adam-art-gallery-feed
Aero Club news aero-club-news
Aikido Tenshindo aikido-tenshindo
All Saints Hataitai news all-saints-hataitai-news
Amesbury Drive School feed amesbury-drive-school-feed
Architecture Centre news architecture-centre-news
Aro Valley Community Centre - News/Blog aro-valley-community-centre-newsblog
Auckland Trains » Wellington auckland-trains-wellington
BCC posts bcc-posts
BNU match reports bnu-match-reports
BNU news bnu-news
Back To The Future back-to-the-future
Binge Culture Collective news binge-culture-collective-news
Bluebridge news bluebridge-news
Bowls Tawa news bowls-tawa-news
Brooklyn Early Childhood Centre news brooklyn-early-childhood-centre-news
Brooklyn Residents Association news brooklyn-residents-association-news
Brooklyn School news brooklyn-school-news
CMHV news cmhv-news
Capital Coast Health Feed capital-coast-health-feed
Capital Mosaic posts capital-mosaic-posts
Capital Times news items capital-times-news-items
CataBlog Feed catablog-feed
Celia Wade-Brown news celia-wade-brown-news
CentrePort news centreport-news
City Gallery media releases city-gallery-media-releases
Click Local feed click-local-feed
Coastguard Mana news coastguard-mana-news
Cricket Wellington news cricket-wellington-news
Cycling in Wellington posts cycling-in-wellington-posts
DCM alerts archive dcm-alerts-archive
Dave Choat - Care not Cuts feed dave-choat-care-not-cuts-feed
Days Bay Residents Association news days-bay-residents-association-news
Downstage news downstage-news
Downstage theatre blog posts downstage-theatre-blog-posts
Dowse news dowse-news
East by West updates east-by-west-updates
Eastbourne Bowling Club news eastbourne-bowling-club-news
Eye of the Fish feed eye-of-the-fish-feed
Fair Trade City Wellington news fair-trade-city-wellington-news
Friends of Futuna Charitable Trust news friends-of-futuna-charitable-trust-news
GW Feed gw-feed
Greens - Wellington feed greens-wellington-feed
HVFPU news hvfpu-news
Harbour City Hockey club news harbour-city-hockey-club-news
Have You Say posts have-you-say-posts
Houghton Valley School news houghton-valley-school-news
Hutt Chick hutt-chick
Hutt City Press Releases hutt-city-press-releases
HuttNZ feed huttnz-feed
Island Bay School news island-bay-school-news
JBC news jbc-news
JJMorgan and co news jjmorgan-and-co-news
Johnsonville Cricket Club news johnsonville-cricket-club-news
Justin Lester blog justin-lester-blog
KTSC news ktsc-news
Kapiti Aero Club news kapiti-aero-club-news
Kapiti Playhouse Inc - News kapiti-playhouse-inc-news
Karori Baptist Church news karori-baptist-church-news
Karori Cricket Club news karori-cricket-club-news
Keep Crossways posts keep-crossways-posts
Keith Johnson posts keith-johnson-posts
LBSLSC news lbslsc-news
LHCAFC news lhcafc-news
Land Search and Rescue in Wellington feed land-search-and-rescue-in-wellington-feed
Lazy Fern blog feed lazy-fern-blog-feed
Life Flight Trust Media Releases life-flight-trust-media-releases
Lions latest news lions-latest-news
MK news mk-news
Manor Park community posts manor-park-community-posts
Mark Greening posts mark-greening-posts
Metlink news metlink-news
Metlink offical news feed metlink-offical-news-feed
Moot Cook mobilised moot-cook-mobilised
Mount Vic Dojo news mount-vic-dojo-news
Multicultural Services Centre of Wellington posts multicultural-services-centre-of-wellington-posts
NRA news nra-news
New Players news new-players-news
Newswire sport feed newswire-sport-feed
Newswire.co.nz news feed newswireconz-news-feed
Newswire.co.nz arts feed newswireconz-arts-feed
Newtown Art Project news newtown-art-project-news
Newtown Festival posts newtown-festival-posts
Ngaio Progressive Association news ngaio-progressive-association-news
North face track blog feed north-face-track-blog-feed
Olympic Harriers news feed olympic-harriers-news-feed
Oriental Bay Residents’ Association posts oriental-bay-residents-association-posts
Ories news ories-news
Petone Rugby Club news petone-rugby-club-news
Petone Rugby club match reports petone-rugby-club-match-reports
Poneke Dojo news poneke-dojo-news
Pukerua Bay Soccer Club news pukerua-bay-soccer-club-news
RPNYC news rpnyc-news
Rainey Collions lawyers news rainey-collions-lawyers-news
Randell Cottage Writers Trust news randell-cottage-writers-trust-news
Raumati Swimming Club news raumati-swimming-club-news
Richter City Roller Derby feed richter-city-roller-derby-feed
Richter City blog feed richter-city-blog-feed
Roosters news roosters-news
Rugby Club Weekly Feed rugby-club-weekly-feed
SSR news ssr-news
Salient Features Feed salient-features-feed
Salient News Feed salient-news-feed
Salient main feed salient-main-feed
Save Crossways campaign feed save-crossways-campaign-feed
Save Kapiti feed save-kapiti-feed
Scots College news scots-college-news
SeniorNet Wellington news seniornet-wellington-news
Sharon Blaikie blog sharon-blaikie-blog
Sidestrip feed sidestrip-feed
Sisters of Compassion news sisters-of-compassion-news
Six oclock swill feed six-oclock-swill-feed
Snapper blog snapper-blog
Spirit Taekwon-Do news spirit-taekwon-do-news
St Pats Silverstream news st-pats-silverstream-news
St Teresas Catholic Parish news st-teresas-catholic-parish-news
Star Boating Club news star-boating-club-news
Star Boating Club news star-boating-club-news
Stokes Valley Volunteer Fire Brigade news stokes-valley-volunteer-fire-brigade-news
Stop Out news stop-out-news
Stopout match reports stopout-match-reports
Sustainable Wellington Transport posts sustainable-wellington-transport-posts
Swim Wellington Feed swim-wellington-feed
T3 Track Blog feed t3-track-blog-feed
Taita Circket Club news taita-circket-club-news
Te Papa blog feed te-papa-blog-feed
Thorndon Residents Assocation blog thorndon-residents-assocation-blog
Tourism Wellington media releases tourism-wellington-media-releases
Transition Towns Brooklyn news transition-towns-brooklyn-news
Tranz Metro news tranz-metro-news
Upper Hutt Hockey Club Game Reports upper-hutt-hockey-club-game-reports
VBC news vbc-news
VHF group news vhf-group-news
VUW News feed vuw-news-feed
VUWSA news vuwsa-news
Vic Library news vic-library-news
Vic Rowing news vic-rowing-news
WCBA blog feed wcba-blog-feed
WCC Watch feed wcc-watch-feed
WCL Blog feed wcl-blog-feed
WCN news wcn-news
WHF news whf-news
WIA news wia-news
WLSAR news wlsar-news
WRFU Feed wrfu-feed
WSAC news wsac-news
Waikanae Golf Club news waikanae-golf-club-news
Wakefield Hospital media releases wakefield-hospital-media-releases
Walking around Wellington posts walking-around-wellington-posts
Watering Hole Ministries what's been happening watering-hole-ministries-whats-been-happening
Wellington Beekeepers Association news wellington-beekeepers-association-news
Wellington City Council Latest News wellington-city-council-latest-news
Wellington Cathedral changed pages wellington-cathedral-changed-pages
Wellington City Council open consultations wellington-city-council-open-consultations
Wellington Civic Trust news wellington-civic-trust-news
Wellington City Council current e-Petitions wellington-city-council-current-e-petitions
Wellington Circus Trust news wellington-circus-trust-news
Wellington East Girls College news wellington-east-girls-college-news
Wellington Greens news wellington-greens-news
Wellington Inner-City Residents and Business Association posts wellington-inner-city-residents-and-business-association-posts
Wellington Jewish Community Centre news wellington-jewish-community-centre-news
Wellington Police news wellington-police-news
Wellington Rugby Referees Associaton news feed wellington-rugby-referees-associaton-news-feed
Wellington Region Cycleways wellington-region-cycleways
Wellington Scoop features wellington-scoop-features
Wellington SPCA news wellington-spca-news
Wellington Samaritans's blog wellington-samaritanss-blog
Wellington Tri news wellington-tri-news
Wellington Tennis Club news wellington-tennis-club-news
Wellington Xiamen Association news wellington-xiamen-association-news
Wellington Zoo News wellington-zoo-news
Wellingtonista Blog Feed wellingtonista-blog-feed
Wesley Community Action news wesley-community-action-news
Wests rugby news wests-rugby-news
Weta News weta-news
Wgtn U-13 Hatch Cup Team 2009 news wgtn-u-13-hatch-cup-team-2009-news
Whitireia Community Polytechnic news whitireia-community-polytechnic-news
Whitireia Community Polytechnic News Feed whitireia-community-polytechnic-news-feed
Your Wellington feed your-wellington-feed
Zephyr Rovers FC zephyr-rovers-fc
drama* on the waterfront posts drama-on-the-waterfront-posts
strathmorepark posts strathmorepark-posts

Usage Example

Example: Using JSON and Javascript to pull the latest transport newsitems into a page.

Transport

Source code

The Javascript source code for the above example is available below.

This example was implemented using the JQuery Javascript library. Any other JSON library could be used.

Following, is a line by line breakdown of what the example is doing:

Lines 1-2: HTML for the Transport heading and an emptry div tag which JQuery will write the newsitems into.

Line 4: Sourcing in the JQuery library file; you would normally do the in the head tag.

Lines 6-8: JQuery. Once the page has finished loading and is ready, fetch JSON data from the API and pass it to the function renderNewsitems.

Lines 10-16: JQuery. The renderNewsitems function is using JQuery to write out the first 4 items from the JSON data as HTML into the empty newsitems div.

Contact

Doing something interesting with this?

Contact enquires (at) wellington.gen.nz and let us know.