Skip to main content

A python package which collects informations from CGTN (China Global TV Network)

Project description

cgtnfeed

A python package which collects information from CGTN (China Global TV Network)

Background

CGTN is a international media from China. Their website is very slow. It is probably because the servers are in China, there are a lot of animations on their website, and the size of the image is very large.

This project is a web scrapper that will collect important information from the website so we won't need to open the website to get informations.

Currently this project collects the titles of the top news from CGTN. In the long run, I will add more data to collect and then make the API.

How to use

Top News

The function get_top_news() returns a list of dictionary. The dictionary currently has three key-value pairs.

Key
----
title
time
category

Example code:

import cgtnfeed

top_news = cgtnfeed.get_top_news()

for news in top_news:
    print(news['title'])

This will print something like this:

Xi Jinping to attend UNGA General Debate via video link
Beijing hails 'advancement in quality of democracy' in Hong Kong
China launches Tianzhou-3 cargo spacecraft for space station mission
Chinese ambassador: U.S.-UK-Australia pact 'extremely irresponsible'
U.S. launches mass expulsion of Haitian migrants from Texas

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cgtnfeed-0.0.1.tar.gz (2.0 kB view hashes)

Uploaded Source

Built Distribution

cgtnfeed-0.0.1-py3-none-any.whl (1.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page