diff options
| author | Pinapelz <yukais@pinapelz.com> | 2025-04-22 18:07:16 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2025-04-22 18:07:16 -0700 |
| commit | 7a59c71c3b3f50784af49a26bbe56e3be618a65e (patch) | |
| tree | b1e3967b4871e756721838cd0c820af8c7ded273 /community | |
| parent | 476f4648a1c8166f938c1e389466aa6f1f7d72d9 (diff) | |
add rbdx_plus support
Diffstat (limited to 'community')
| -rw-r--r-- | community/rbdx.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/community/rbdx.py b/community/rbdx.py new file mode 100644 index 0000000..d5044e0 --- /dev/null +++ b/community/rbdx.py @@ -0,0 +1,29 @@ +from bs4 import BeautifulSoup +from urllib.parse import urljoin +from datetime import datetime +import time + +def get_carousel_posts(html: str): + soup = BeautifulSoup(html, 'html.parser') + base_url = "https://dxplus.chilundui.com/" + carousel = soup.find('div', class_='carousel-inner') + if not carousel: + return [] + + news_posts = [] + current_date_string = datetime.now().strftime('%Y-%m-%d %H:%M:%S') + current_unix_time = int(time.time()) + for item in carousel.find_all('div', class_='carousel-item'): + img_tag = item.find('img') + if img_tag and img_tag.get('src'): + news_posts.append({ + "date": current_date_string, + "identifier": "REFLEC_BEAT_DELUXE_PLUS", + "type": None, + "timestamp": current_unix_time, + "url": None, + "headline": None, + "content": "[お知らせ] ANNOUNCEMENT FROM REFLECT BEAT DELUXE PLUS", + "images": urljoin(base_url, img_tag['src']) + }) + return news_posts |
