{"id":4527,"date":"2025-05-03T07:10:01","date_gmt":"2025-05-02T22:10:01","guid":{"rendered":"https:\/\/matoken.org\/blog\/?p=4527"},"modified":"2025-05-03T07:13:01","modified_gmt":"2025-05-02T22:13:01","slug":"bbc_weather_scraper-allows-you-to-check-bbc-weather-information-on-tui","status":"publish","type":"post","link":"https:\/\/matoken.org\/blog\/2025\/05\/03\/bbc_weather_scraper-allows-you-to-check-bbc-weather-information-on-tui\/","title":{"rendered":"TUI\u3067BBC\u306e\u5929\u6c17\u60c5\u5831\u304c\u78ba\u8a8d\u3067\u304d\u308bbbc_weather_scraper"},"content":{"rendered":"<div class=\"paragraph\">\n<p>BBC\u306e\u5929\u6c17\u60c5\u5831\u3092\u53d6\u5f97\u3057\u3066TUI\u3067\u8868\u793a\u3059\u308bbbc_weather_scraper\u3068\u3044\u3046\u30c4\u30fc\u30eb\u3092\u77e5\u3063\u305f\u306e\u3067\u5c11\u3057\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\uff0e<br \/>\nBBC\u306e\u5929\u6c17\u60c5\u5831\u306f\u7d30\u304b\u306a\u571f\u5730\u306b\u306f\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u305b\u3093\u304c\u5168\u4e16\u754c\u306e\u5929\u6c17\u304c\u78ba\u8a8d\u3067\u304d\uff0conion site\u3082\u3042\u3063\u3066\u4fbf\u5229\u3067\u3059\uff0e<\/p>\n<\/div>\n<div class=\"ulist\">\n<ul>\n<li>\n<p><a href=\"https:\/\/github.com\/leonmavr\/bbc_weather_scraper\">leonmavr\/bbc_weather_scraper: Tiny weather scraper for https:\/\/www.bbc.com\/weather<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.reddit.com\/r\/commandline\/comments\/1kbesbn\/bbc_weather_forecast_as_tiles\/\">BBC weather forecast as tiles : r\/commandline<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<p><!--more--><\/p>\n<div class=\"listingblock\">\n<div class=\"title\">\u5c0e\u5165<\/div>\n<div class=\"content\">\n<pre>$ git clone https:\/\/github.com\/leonmavr\/bbc_weather_scraper\n$ cd bbc_weather_scraper\n$ python -m venv venv\n$ source venv\/bin\/activate\n$ pip install -r requirements.txt<\/pre>\n<\/div>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\">error1<\/div>\n<div class=\"content\">\n<pre>$ .\/scraper.py\nTraceback (most recent call last):\n  File \"\/home\/matoken\/src\/bbc_weather_scraper\/.\/scraper.py\", line 3, in &lt;module&gt;\n    from hourly import fmt_day_hourly\n  File \"\/home\/matoken\/src\/bbc_weather_scraper\/hourly.py\", line 1, in &lt;module&gt;\n    import requests\nModuleNotFoundError: No module named 'requests'<\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p><code>requests<\/code> \u304c\u8db3\u308a\u306a\u3044\u3088\u3046\u306a\u306e\u3067\uff0crequirements.txt \u306b <code>requests<\/code> \u3092\u8ffd\u52a0\u3057\u3066 <code>pip install -r requirements.txt<\/code> \u3092\u518d\u5b9f\u884c\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\">error2<\/div>\n<div class=\"content\">\n<pre>$ .\/scraper.py\nTraceback (most recent call last):\n  File \"\/home\/matoken\/src\/bbc_weather_scraper\/.\/scraper.py\", line 8, in &lt;module&gt;\n    from pynput import keyboard\nModuleNotFoundError: No module named 'pynput'<\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>\u4eca\u5ea6\u306f <code>pynput<\/code> \u304c\u8db3\u308a\u306a\u3044\u3088\u3046\u306a\u306e\u3067 <code>requirements.txt<\/code> \u306b\u8ffd\u52a0\u3057\u3066 <code>pip install -r requirements.txt<\/code> \u3092\u518d\u5b9f\u884c\uff0e<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>\u3053\u308c\u3067\u52d5\u4f5c\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\">\u4fee\u6b63\u5f8c\u306e <code>requirements.txt<\/code><\/div>\n<div class=\"content\">\n<pre>$ git diff\ndiff --git a\/requirements.txt b\/requirements.txt\nindex b6942e8..9172c97 100644\n--- a\/requirements.txt\n+++ b\/requirements.txt\n@@ -1,3 +1,5 @@\n beautifulsoup4==4.12.3\n wcwidth==0.2.13\n geopy\n+requests\n+pynput<\/pre>\n<\/div>\n<\/div>\n<div class=\"admonitionblock note\">\n<table  class=\" table table-hover\" >\n<tr>\n<td class=\"icon\">\n<div class=\"title\">Note<\/div>\n<\/td>\n<td class=\"content\">\n<a href=\"https:\/\/github.com\/leonmavr\/bbc_weather_scraper\/issues\/1\">\u5831\u544a\u3057\u305f<\/a>\u306e\u3067<a href=\"https:\/\/github.com\/leonmavr\/bbc_weather_scraper\/commit\/03152c21dff1229f764a9a02e4c2d884f7f9aae1\">\u4fee\u6b63\u3055\u308c\u307e\u3057\u305f<\/a>\uff0e\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<div class=\"paragraph\">\n<p>\u5f15\u6570\u306a\u3057\u3067\u5b9f\u884c\u3059\u308b\u3068 <code>city_ids.dat<\/code> \u5185\u304b\u3089\u8fd1\u304f\u3067\u3042\u308d\u3046\u5834\u6240\u304c\u9078\u3070\u308c\u307e\u3059\uff0e<br \/>\nKagoshima\u306a\u3069BBC\u306b\u306f\u3042\u308b\u3051\u308c\u3069\u3053\u306e\u30ea\u30b9\u30c8\u306b\u306a\u3044\u5834\u6240\u306e\u5834\u5408\u4ee5\u4e0b\u306e\u30da\u30fc\u30b8\u304b\u3089\u63a2\u3057\u3066URL\u306e\u6700\u5f8c\u306eID\u3092\u30e1\u30e2\u3057\u307e\u3059\uff0eKagoshima\u306e\u5834\u5408\uff0c URL\u306f <code><a href=\"https:\/\/www.bbc.com\/weather\/6300348\" class=\"bare\">https:\/\/www.bbc.com\/weather\/6300348<\/a><\/code> \u3067\uff0cID\u306f <code>6300348<\/code> \u3067\u3059\uff0e<\/p>\n<\/div>\n<div class=\"ulist\">\n<ul>\n<li>\n<p><a href=\"https:\/\/www.bbc.com\/weather\">BBC Weather &#8211; Home<\/a><\/p>\n<div class=\"ulist\">\n<ul>\n<li>\n<p><a href=\"https:\/\/www.bbcweb3hytmzhn5d532owbu6oqadra5z3ar726vq5kgwwn6aucdccrad.onion\/weather\">onion site<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/li>\n<\/ul>\n<\/div>\n<div class=\"paragraph\">\n<p><code>city_ids.dat<\/code> \u306b\u540d\u524d\u3068\u3053\u306eID\u3092\u8ffd\u52a0\u3057\u307e\u3059\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre>Kagoshima: 6300348<\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>\u5f15\u6570\u306b\u540d\u524d\u3092\u66f8\u304f\u3053\u3068\u3067\u6307\u5b9a\u3057\u305f\u5834\u6240\u304c\u958b\u3051\u307e\u3059\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre>$ .\/scraper.py Kagoshima<\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>\u66f4\u306b\u7def\u5ea6\uff0c\u7d4c\u5ea6\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre>Kagoshima: 6300348: 31.801837, 130.719404<\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>\u81ea\u5206\u306e\u74b0\u5883\u3067\u306f\u7269\u7406\u7684\u306b\u306fKagoshima\u304c\u8fd1\u3044\u306e\u3067\u3059\u304c\uff0cTokyo\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\uff0e<br \/>\n\u3053\u308c\u306f\u56de\u7dda\u306b\u3088\u308b\u306e\u3060\u3068\u601d\u3044\u307e\u3059\uff0e<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>\u8d77\u52d5\u3057\u305f\u3089wasd\u3067\u65e5\u306b\u3061\u3092\u79fb\u52d5\uff0cf\u3067\u8a73\u7d30\u3092\u958b\u3051\u307e\u3059\uff0ex\u3067\u623b\u308a\uff0cq\u3067\u7d42\u4e86\u3067\u3059\uff0e<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>\u52d5\u4f5c\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u306e\u3067\u3059\u304c\uff0c\u4f55\u3082\u3057\u306a\u304f\u3066\u3082\u7d30\u304b\u304f\u30d5\u30e9\u30c3\u30b7\u30e5\u3055\u308c\u3066\u898b\u3065\u3089\u3044\u3067\u3059\uff0e<br \/>\n<a href=\"https:\/\/github.com\/leonmavr\/bbc_weather_scraper\/blob\/master\/assets\/demo.gif\">demo<\/a>\u3067\u306f\u305d\u3093\u306a\u3053\u3068\u306f\u306a\u3055\u305d\u3046\u306a\u306e\u3067\u306a\u306b\u304b\u306e\u74b0\u5883\u304c\u60aa\u3044\u306e\u304b\u3082\u3057\u308c\u307e\u305b\u3093\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\">\u74b0\u5883<\/div>\n<div class=\"content\">\n<pre>$ git log --pretty=oneline -1\ne648ad41b5d192ff2e21bebb18feece7981ef4de (HEAD -&gt; master, origin\/master, origin\/HEAD) Add requirements\n$ python --version\nPython 3.13.3\n$ dpkg-query -W python3 python3-venv python3-pip\npython3 3.13.3-1\npython3-pip     25.1+dfsg-1\npython3-venv    3.13.3-1\n$ lsb_release -a\nNo LSB modules are available.\nDistributor ID: Debian\nDescription:    Debian GNU\/Linux trixie\/sid\nRelease:        n\/a\nCodename:       trixie\n$ arch\nx86_64<\/pre>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>BBC\u306e\u5929\u6c17\u60c5\u5831\u3092\u53d6\u5f97\u3057\u3066TUI\u3067\u8868\u793a\u3059\u308bbbc_weather_scraper\u3068\u3044\u3046\u30c4\u30fc\u30eb\u3092\u77e5\u3063\u305f\u306e\u3067\u5c11\u3057\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\uff0e BBC\u306e\u5929\u6c17\u60c5\u5831\u306f\u7d30\u304b\u306a\u571f\u5730\u306b\u306f\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u305b\u3093\u304c\u5168\u4e16\u754c\u306e\u5929\u6c17\u304c\u78ba\u8a8d\u3067\u304d\uff0conion site [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"webmentions_disabled_pings":false,"webmentions_disabled":false,"activitypub_content_warning":null,"activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"federated","footnotes":""},"categories":[7,6,199],"tags":[1202,654,831],"class_list":["post-4527","post","type-post","status-publish","format-standard","hentry","category-debian-linux","category-linux","category-sid","tag-bbc","tag-tui","tag-weather"],"_links":{"self":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/4527","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/comments?post=4527"}],"version-history":[{"count":3,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/4527\/revisions"}],"predecessor-version":[{"id":4536,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/4527\/revisions\/4536"}],"wp:attachment":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/media?parent=4527"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/categories?post=4527"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/tags?post=4527"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}