Skip to content

iorixxx/Thai-news-retrieval

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Thai News Crawler

Introduction

This project crawls Thai news articles from the dailynews.co.th Web site. The articles are saved in a directory structure based on categories in JSON file format. Later on these JSon files will be indexed to an Apache Solr instance using the java -Dtype=application/json -Dc=news -Durl=http://localhost:8983/solr/news/update/json/docs -jar post.jar data/*/*.json command.

Each article has the following fields:

  • id: a unique identifier for the article
  • url: the URL of the article
  • title: the title of the article
  • content: the textual content of the article (may occasionally contain HTML and JavaScript content)
  • category: the category of the article source (e.g. politics, education, bangkok, etc.)
  • date: the publication date of the article
  • description: the description of the article (meta tag)
  • keywords: the keywords of the article (meta tag)

Below is an example article : (content and keywords have been truncated)

{
  "id": 577336,
  "title": "ประกวดร้องเพลงพระราชนิพนธ์ชิงรางวัลรวมกว่า250,000บาท | เดลินิวส์",
  "description": "กทม.จัดประกวดขับร้องเพลงพระราชนิพนธ์ เทอดพระเกียรติรัชกาลที่9 ชิงรางวัลรวมกว่า 250,000บาท",
  "keywords": "ร้องเพลงพระราชนิพนธ์ กทม. สำนักวัฒนธรรม,เดลินิวส์,เดลินิวส์ออนไลน์,เดลินิวส์วันนี้,ข่าวเดลินิวส์ออนไลน์,ข่าวเดลินิวส์ล่าสุด,ข่าว,ข่าวด่วน,ข่าววันนี้, ... ",
  "category": "bangkok",
  "text": "นายภัทรุตม์ ทรรทรานนท์ ปลัดกรุงเทพมหานคร (กทม.)เป็นประธานใน กิจกรรมการแถลงข่าว ประกวดร้องเพลงพระราชนิพนธ์ในพระบาสมเด็จพระปรมินทรมหาภูมิพลอดุลยเดช ...",
  "url": "https://www.dailynews.co.th/bangkok/577336",
  "date": "2017-06-03T14:11:47.163Z"
}

I will use this in my Solr boot-camp (Thai news retrieval demo) at the School of Information Technology, King Mongkut's University of Technology Thonburi (KMUTT) .

Tools

Framework is distributed as booth tar.gz and tar.zip files which can be generated by mvn clean package dependency:copy-dependencies assembly:single command. The distribution files include an executable script named run.sh, (and also run.cmd for Windows) which is used to start the crawl.

Cron Job

To schedule the crawl on every two hours, use the following cron job

0 */2 * * * cd /home/iorixxx/ThaiNews-1.0 && ./run.sh > /dev/null 2>&1

Dependencies

  • JDK 1.8 or above
  • Apache Maven 3.0.3 or above

Author

Please feel free to contact Ahmet Arslan at [email protected] if you have any questions, comments or contributions.

Examples

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published