Code Monkey home page Code Monkey logo

jobs-feed-refactor's Introduction

#jobs-feed-refactor

Takes an xml output from a recruitment database, uses Google Feeds API to import the xml, filters it on various parameters and displays it in separate html files for iframing into a CMS-driven site.

This is a refactoring of jobs-xml-feed using the third commit as a starting point.

Firstly, the single javascript file was split into modules for:

  • loading the xml;
  • parsing it and creating javascript objects;
  • formatting the dates;
  • pushing the data to arrays based on the category and/or location of each job;
  • creating an html table of whichever array needed to be displayed;
  • storing the variables, allowing them to be more easily edited by non-coders.

The 'location' and 'category' objects were moved into an external JSON file, again to make it easy for editing.

The code which looks for the divs on the page to match the data to was moved so that it runs before the creation of the arrays, meaning that it only has to create the array(s) that are needed for each htm page.

In March 2015 I found out that, as from 20 April 2015, the Google Feeds API could be switched off at any time, so the next stage of the project is to rewrite this code using jQuery, producing a custom version that only loads the code I need. I will avoid a problem with loading xml cross-domain by using server space on the same domain as the jobs database.

The live pages are here (although there may be no jobs available in the database at the time): http://www.cutours.co.uk/staffrecruitment/research-research.htm http://www.cutours.co.uk/staffrecruitment/research-support.htm http://www.cutours.co.uk/staffrecruitment/research-cawr.htm [and similar urls which match the other file names]

jobs-feed-refactor's People

Contributors

judegibbons avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.