Parses url and title

pull/3/head
nrfq 2021-10-16 15:57:23 -04:00
parent 8a450948c6
commit 71368f97c2
2 changed files with 10 additions and 3 deletions

View File

@ -79,7 +79,13 @@ let exportJSON = function(children, langCode, mediaType, outputFile="root.json")
* @return {Object} Returns an Object containing details about the piece of media Exact format TBD. * @return {Object} Returns an Object containing details about the piece of media Exact format TBD.
*/ */
let parseListItem = function(listItem){ let parseListItem = function(listItem){
return "NEEDS TO BE IMPLEMENTED"; // console.log(listItem);
let entry = {};
const link = listItem[0];
entry.url = link.url;
entry.title = link.children[0].value;
// remember to get OTHER STUFF!! remember there may be multiple links!
return entry;
} }
let main = function(inputFile, langCode, mediaType, outputFile){ let main = function(inputFile, langCode, mediaType, outputFile){
@ -119,7 +125,6 @@ let main = function(inputFile, langCode, mediaType, outputFile){
} }
catch(e){ catch(e){
console.log(children[children.length-1]); console.log(children[children.length-1]);
// console.log(tree[i]);
console.log("error"); console.log("error");
return 1; return 1;
} }

View File

@ -128,8 +128,10 @@ const languages = {
'pa': 'Panjabi, Punjabi', 'pa': 'Panjabi, Punjabi',
'ps': 'Pashto, Pushto', 'ps': 'Pashto, Pushto',
'fa': 'Persian', 'fa': 'Persian',
'fa-IR': 'Persian (Iran)',
'pl': 'Polish', 'pl': 'Polish',
'pt': 'Portuguese', 'pt-BR': 'Portuguese (Brazil)',
'pt-PT': 'Portuguese (Portugal)',
'qu': 'Quechua', 'qu': 'Quechua',
'rm': 'Romansh', 'rm': 'Romansh',
'rn': 'Rundi', 'rn': 'Rundi',