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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file cgtnfeed-0.0.1.tar.gz.

File metadata

  • Download URL: cgtnfeed-0.0.1.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.5

File hashes

Hashes for cgtnfeed-0.0.1.tar.gz
Algorithm Hash digest
SHA256 7292e15b7057e40bbda714f5895608f02151c4ee4ce705fea68146db465cb6df
MD5 01b31ed9d1e6aa094703680c59eb1b7b
BLAKE2b-256 4f5b6b75b1dcd4bff8287804f8594b13fe8183ca1f4704597e8d9cb8548eafa1

See more details on using hashes here.

File details

Details for the file cgtnfeed-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: cgtnfeed-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 1.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.5

File hashes

Hashes for cgtnfeed-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 414056905cd753a6b9bcbd2fc76ff5f584e28811fc59a303d46bb1a0e3e4736c
MD5 3e2083115b49358ad450565c540f7756
BLAKE2b-256 51bca3e71f5d50c6d05178f4fe099079ee0980895b7167c359db9862cd2e7967

See more details on using hashes here.

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