Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/madcoda/node-appledaily-parser
Parse content of Apple daily
https://github.com/madcoda/node-appledaily-parser
Last synced: about 1 month ago
JSON representation
Parse content of Apple daily
- Host: GitHub
- URL: https://github.com/madcoda/node-appledaily-parser
- Owner: madcoda
- License: mit
- Created: 2016-06-03T12:42:25.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-06-04T09:01:56.000Z (over 8 years ago)
- Last Synced: 2024-11-21T05:31:17.244Z (about 2 months ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
appledaily-parser
==========Parse content on the Apple Daily HK website in Node.js
## Usage
In your project
npm install appledaily-parser --save
In your main js file
var AppleDaily = require('appledaily-parser')();
AppleDaily.sections().then(function(sections){console.log(sections);
// display in the menu,
// or use to loop through articles in each sectionvar cat1 = sections[0];
cat1.articles().then(function(articles){console.log(articles);
// todo: do whatever to the list of articles
var article1 = articles[0];
// call getArticle to fetch the full detail
article1.getArticle().then(function(article){// todo
})
});
});
## Format
Section
{
label: string,
url: string,
articles: [func]
}Article (List)
{
title: string,
url: string,
image: string,
relativeTime: string, // only present for realtime news
getArticle: [func]
}Article (Detail)
{
id: string,
date: date,
views: string,
title: string, //title when shared to facebook
realTitle: string, //title shown on the webpage
images: array,
content: string,
permalink: string
}