How to automatically download files from atom feed

How to automatically download files from atom feed

how to automatically download files from atom feed

The Basic Structure The top level of an RSS document is the rss version="" element. Some feed applications can download these files automatically. automatic fetch documents and images from rss/atom feeds - hizzgdev/feedfetch. www.cronistalascolonias.com.ar › wiki › RSS. how to automatically download files from atom feed

How to automatically download files from atom feed - apologise

Article

Introduction

ATOM feeds are a useful way to share frequently updated content; users can subscribe to a feed and automatically have access to the most up-to-date data. INSPIRE* data download requirements can be met using ATOM feeds, and a number of organizations are doing so.

FME’s GeoRSS/RSS Feed Reader and Writer supports RSS and ATOM, enabling users to read and write ATOM feeds. In this demo, two workspaces are used in combination with FME Server to create an ATOM feed:

1) One workspace creates the ATOM feed and should be published with the Data Streaming service to FME Server. When this workspace is run via, it streams back the RSS/ATOM feed which includes links to downloadable INSPIRE data layers.

2) If a user selects a download link for an INSPIRE data layer from the ATOM service, this triggers the second workspace to run and return the XML via the Data Streaming service.

Note: when the ATOM feed workspace is run via the Data Streaming service, links to download data are displayed. If you view the data in Firefox or Internet Explorer ATOM feeds are automatically rendered. Google Chrome does not automatically render ATOM feeds but there are browser extensions available to do this.

Create the ATOM feed

Downloads

  • InspireAtomDownloadService_vzip

In order to complete this exercise you will also need to download the WMS INSPIRE data covering Westminster and Brent London Boroughs.

Step 1. INSPIRE Data Download workspace

  • Open the www.cronistalascolonias.com.ar workspace, and in the Navigator Window double click on the Source parameter for both the Brent and Westminster INSPIRE GML Readers and update these with the location of your XML files.
  • Ensure the workspace runs locally, check the INSPIRE GML output in the Data Inspector.
  • Publish the workspace to FME Server, in the INSPIRE repository (if necessary, create an INSPIRE repository when publishing to server), and register the workspace with the Data Streaming Service.

Publish www.cronistalascolonias.com.ar workspace

Step 2. ATOM feed workspace

  • Open the www.cronistalascolonias.com.ar workspace.
  • Under Private Parameters, modify the FMEServerRoot, username, password and FME token entries to match that of the FME Server host that will be used. Optionally, modify the Title, Description, and Author parameters.

Edit Private Parameter values from the Navigation Window

  • To obtain a token open the FME Server web interface, select the User Settings icon in the top right corner and select Manage Token. By default these tokens expire after 30 minutes. Generate a new token with a longer expiration time and then copy and paste this into the Token parameter. Note the expiry date, so you can set a new one when necessary.

Obtain a token and note its expiry date

  • Run the workspace locally, to ensure that an XML document is written that contains feed and entry data. Entries for Brent Smoke Control Zones and Westminster Smoke Control Areas should be present.
  • Publish the www.cronistalascolonias.com.ar workspace to FME Server, registering it with the Data Streaming service. When the workspace is run via the Data Streaming service, an ATOM feed XML document is generated which includes data download links. The links point to the workspace published in Step 1 and when clicked will provide the actual GML data via the Data Streaming Service.

View the ATOM feed

Obtain Direct URL

  • Using Internet Explorer, it is easy to obtain an ATOM feed “look”, as it can render ATOM/RSS feeds. In Internet Explorer, go to the FME Server Web Interface, then Run the INSPIREAtomFeed Workspace.
  • Return to the Run Workspace page in FME Server and open the Advanced tab to find the Direct URL.
  • The Direct URL Example shown is the URL required to run this workspace. This link provides users with access to the ATOM feed without needing access to FME Server’s Web Interface. The URL will look similar to:
http://<host>:<port>/fmedatastreaming/INSPIRE/www.cronistalascolonias.com.ar?

Accessing the URL for the ATOM feed service

Provide Open Access

By default authentication is required to run the workspace and stream the ATOM feed via the Direct URL. This link can be made publicly available without the need for authentication by configuring the security settings of the INSPIRE repository to be open to the fmeguest account.

1. In FME Server, click on Roles under Administration > Security in the menu on the left.

Location of Security in Menu bar

2. Select the fmeguest role

3. Under Repositories give Read / Run permissions to the INSPIRE folder. Also ensure that under Services, Data Streaming is allowed.

fmeguest Role Policies to enable access to the service

Result: View the Service

Click on the URL or Paste it into a new Internet Explorer browser, to see the ATOM feed as shown below. Click on the link to download a zip file containing the associated INSPIRE GML.

The INSPIRE ATOM feed viewed with Internet Explorer

* INSPIRE, or Infrastructure for Spatial Information in Europe, is a European Union directive that aims to create a spatial data infrastructure of EU data. Open standards such as OGC web services are used to facilitate the exchange of INSPIRE data. For more information please visit the INSPIRE website.

If you have any questions or require assistance, please contact support.

Data Attribution

Data used in this tutorial originates from data made available by INSPIRE. It contains informationlicensed under the Creative Commons Attribution (cc-by) and the INSPIRE End User Licence.

Источник: www.cronistalascolonias.com.ar

How to automatically download files from atom feed

1 thoughts to “How to automatically download files from atom feed”

Leave a Reply

Your email address will not be published. Required fields are marked *