kibua20 / devdocs Goto Github PK
View Code? Open in Web Editor NEWGit repository for Kibua20's blog. See our web site
Home Page: https://kibua20.tistory.com/
License: GNU General Public License v3.0
Git repository for Kibua20's blog. See our web site
Home Page: https://kibua20.tistory.com/
License: GNU General Public License v3.0
블로그 댓글을 작성하면 코드가 잘 작성되지 않아 이렇게 깃헙이슈로 남기게 됬습니다.
해당 게시글에 더해 Reply를 보내는 방법을 찾다가 해답을 찾아서 이렇게 남기게 됬습니다.
70~73번째 줄의
try:
return {'raw': base64.urlsafe_b64encode(message.as_string())}
except:
return {'raw': base64.urlsafe_b64encode(message.as_bytes()).decode('utf8')}
위에 해당하는 코드를
try:
return {'raw': base64.urlsafe_b64encode(message.as_string()), 'threadId': '스레드 ID(숫자)'}
except:
return {'raw': base64.urlsafe_b64encode(message.as_bytes()).decode('utf8'), 'threadId': '스레드 ID(숫자)'}
로 바꾸어 주었더니 해당 스레드에 Reply형식으로 메일이 보내졌습니다.
스레드라 함은 알고보니 그냥 한개의 메일을 Gmail에서는 스레드라고 하는것 같았습니다.
위의 사진처럼 스레드 ID는 단순히 스레드 ID를 알고싶은 메일에 들어가서 주소창을 보면 맨끝의 FMfcgzGmtNdjmjGGmWGwgxVvzqQrXdfh
와 같은 문자로 알수 있는데요.
이 문자는 스레드 ID가 맞긴 하지만 실제로 저희의 Python 코드에는 숫자형식
의 스레드 ID가 들어가야했습니다.
그래서 해당 문자를 숫자형식의 스레드 ID로 바꾸는 방법은 여기에서 알수 있었습니다.
document.querySelector('[data-legacy-thread-id]').getAttribute('data-legacy-thread-id')
해당 JS를 확인하고싶은 메일에 들어가서 개발자도구를 열어 console창에 복붙하시게 되면 숫자 형식의 스레드 아이디를 확인하실수 있습니다.
이렇게 얻은 스레드 ID를 저희 파이썬 코드에 넣으면 정상적으로 Reply 메일이 보내집니다.
다시한번 훌륭한 글을 작성해주셔서 너무 감사드립니다!!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.