Skip to content

Instantly share code, notes, and snippets.

@mtrunkat
Last active March 5, 2020 12:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mtrunkat/63f19449e78875f474ca0e28fbdb658c to your computer and use it in GitHub Desktop.
Save mtrunkat/63f19449e78875f474ca0e28fbdb658c to your computer and use it in GitHub Desktop.
function pageFunction(context) {
var $ = context.jQuery;
// All h4 headings containing date - <h4>2016-11-24</h4>
var headings = $('.page-content h4');
// All descriptions - <ul><li>General: ...</li>...</ul>
var lists = $('.page-content ul');
// Iterate thru all release notes
var result = [];
for (var i = 0; i < headings.length; i ++) {
var date = headings[i].innerText;
var description = lists[i].outerHTML;
result.push({
title : date + ' Release notes',
description : description,
link : 'http://apifier.com/release-notes#' + date,
guid : date,
pubDate : (new Date(date)).toUTCString()
});
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment