Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unitreeのメールに星座占いを追加 #1

Conversation

MiyabiTane
Copy link

@tkmtnt7000
スパーキーのメールに星座占いを追加してみました。お時間ある時に試してみてほしいです。実行にpip install emojiが必要です

関数での動作は確認済みですが、このスクリプトはすぐ手元で動かせず動作確認できていないのでエラー等吐いたらお知らせください。お手数おかけして申し訳ないです...。
よろしくお願いします

k-okada#24

@tkmtnt7000
Copy link
Owner

@tkmtnt7000
Copy link
Owner

めっちゃいい感じですね!

Comment on lines 106 to 107
       4: ":astonished:", 5: ":cry:", 6: ":angry:", 7: ":flushed:",
  8: ":scream:", 9: ":heart_eyes:", 10: ":wink:", 11: ":sleepy:", 12: ":sweat:"}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

全角スペースが入っているような気がします

Comment on lines 162 to 178
soup = BeautifulSoup(response, "html.parser")
fortune = soup.find('div', id="jumpdtl").find_all('td')
f_contents = soup.find('div', class_="yftn12a-md48").find_all('dd')[0].contents[0]
rank = fortune[-5].contents[0].contents[0][0:2]
point_overall = fortune[-3].contents[0].attrs['alt']
point_love = fortune[-3].contents[0].attrs['alt']
point_money = fortune[-2].contents[0].attrs['alt']
point_business = fortune[-1].contents[0].attrs['alt']
message = "今日の星座占い:いて座の運勢は【" + rank + "】" + add_comment_rank(int(rank[0])) + "\n"
message += f_contents + "\n"
message += "だって!\n"
message += "\n"
message += "総合運: " + point_overall + "\n"
message += "恋愛運: " + point_love + add_comment_love(int(point_love[-2])) + "\n"
message += "金運: " + point_money + add_comment_money(int(point_money[-2])) + "\n"
message += "仕事運: " + point_money + add_comment_business(int(point_business[-2])) + "\n"
response.close()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

この部分はpython2系でも動く気がするのでインデントを一つ上げてelseから出しておいても良いかと思いました.

@MiyabiTane
Copy link
Author

早速のご対応ありがとうございます!
直したのでご確認お願いします

api_key_file = '/var/lib/robot/openweathermap_api_key.txt'
このファイルが手元になかったので関連事項をコメントアウトしてデバッグしました

@tkmtnt7000 tkmtnt7000 merged commit f57b932 into tkmtnt7000:PR-email-when-launching May 17, 2022
tkmtnt7000 pushed a commit that referenced this pull request Aug 22, 2022
euscollada is now released on noetic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants