import feedparser, datetime, numpy
blog_url = "https://star77sa.github.io/index.xml"
feed = feedparser.parse(blog_url)
feed
{'bozo': False,
 'entries': [{'title': 'Post With Code',
   'title_detail': {'type': 'text/plain',
    'language': None,
    'base': 'https://star77sa.github.io/index.xml',
    'value': 'Post With Code'},
   'authors': [{'name': 'Harlow Malloc'}],
   'author': 'Harlow Malloc',
   'author_detail': {'name': 'Harlow Malloc'},
   'links': [{'rel': 'alternate',
     'type': 'text/html',
     'href': 'https://star77sa.github.io/posts/post-with-code/index.html'}],
   'link': 'https://star77sa.github.io/posts/post-with-code/index.html',
   'summary': '<p>This is a post with executable code.</p>',
   'summary_detail': {'type': 'text/html',
    'language': None,
    'base': 'https://star77sa.github.io/index.xml',
    'value': '<p>This is a post with executable code.</p>'},
   'tags': [{'term': 'news', 'scheme': None, 'label': None},
    {'term': 'code', 'scheme': None, 'label': None},
    {'term': 'analysis', 'scheme': None, 'label': None}],
   'id': 'https://star77sa.github.io/posts/post-with-code/index.html',
   'guidislink': False,
   'published': 'Sat, 26 Aug 2023 15:00:00 GMT',
   'published_parsed': time.struct_time(tm_year=2023, tm_mon=8, tm_mday=26, tm_hour=15, tm_min=0, tm_sec=0, tm_wday=5, tm_yday=238, tm_isdst=0),
   'media_content': [{'url': 'https://star77sa.github.io/posts/post-with-code/image.jpg',
     'medium': 'image',
     'type': 'image/jpeg'}]},
  {'title': 'Welcome To My Blog',
   'title_detail': {'type': 'text/plain',
    'language': None,
    'base': 'https://star77sa.github.io/index.xml',
    'value': 'Welcome To My Blog'},
   'authors': [{'name': "Tristan O'Malley"}],
   'author': "Tristan O'Malley",
   'author_detail': {'name': "Tristan O'Malley"},
   'links': [{'rel': 'alternate',
     'type': 'text/html',
     'href': 'https://star77sa.github.io/posts/welcome/index.html'}],
   'link': 'https://star77sa.github.io/posts/welcome/index.html',
   'summary': '<p>This is the first post in a Quarto blog. Welcome!</p>\n<p><img class="img-fluid" src="https://star77sa.github.io/posts/welcome/thumbnail.jpg" /></p>\n<p>Since this post doesn’t specify an explicit <code>image</code>, the first image in the post will be used in the listing page of posts.</p>',
   'summary_detail': {'type': 'text/html',
    'language': None,
    'base': 'https://star77sa.github.io/index.xml',
    'value': '<p>This is the first post in a Quarto blog. Welcome!</p>\n<p><img class="img-fluid" src="https://star77sa.github.io/posts/welcome/thumbnail.jpg" /></p>\n<p>Since this post doesn’t specify an explicit <code>image</code>, the first image in the post will be used in the listing page of posts.</p>'},
   'tags': [{'term': 'news', 'scheme': None, 'label': None}],
   'id': 'https://star77sa.github.io/posts/welcome/index.html',
   'guidislink': False,
   'published': 'Wed, 23 Aug 2023 15:00:00 GMT',
   'published_parsed': time.struct_time(tm_year=2023, tm_mon=8, tm_mday=23, tm_hour=15, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=235, tm_isdst=0)}],
 'feed': {'title': 'Time Series',
  'title_detail': {'type': 'text/plain',
   'language': None,
   'base': 'https://star77sa.github.io/index.xml',
   'value': 'Time Series'},
  'links': [{'rel': 'alternate',
    'type': 'text/html',
    'href': 'https://star77sa.github.io/index.html'},
   {'href': 'https://star77sa.github.io/index.xml',
    'rel': 'self',
    'type': 'application/rss+xml'}],
  'link': 'https://star77sa.github.io/index.html',
  'subtitle': '',
  'subtitle_detail': {'type': 'text/html',
   'language': None,
   'base': 'https://star77sa.github.io/index.xml',
   'value': ''},
  'generator_detail': {'name': 'quarto-1.3.450'},
  'generator': 'quarto-1.3.450',
  'updated': 'Sat, 26 Aug 2023 15:00:00 GMT',
  'updated_parsed': time.struct_time(tm_year=2023, tm_mon=8, tm_mday=26, tm_hour=15, tm_min=0, tm_sec=0, tm_wday=5, tm_yday=238, tm_isdst=0)},
 'headers': {'connection': 'close',
  'content-length': '763',
  'server': 'GitHub.com',
  'content-type': 'application/xml',
  'permissions-policy': 'interest-cohort=()',
  'last-modified': 'Mon, 28 Aug 2023 05:42:39 GMT',
  'access-control-allow-origin': '*',
  'strict-transport-security': 'max-age=31556952',
  'etag': 'W/"64ec33cf-736"',
  'expires': 'Mon, 28 Aug 2023 06:01:10 GMT',
  'cache-control': 'max-age=600',
  'content-encoding': 'gzip',
  'x-proxy-cache': 'MISS',
  'x-github-request-id': '1080:454B:18DE9A:1A4734:64EC35CE',
  'accept-ranges': 'bytes',
  'date': 'Mon, 28 Aug 2023 05:51:40 GMT',
  'via': '1.1 varnish',
  'age': '29',
  'x-served-by': 'cache-itm18840-ITM',
  'x-cache': 'HIT',
  'x-cache-hits': '1',
  'x-timer': 'S1693201900.263213,VS0,VE1',
  'vary': 'Accept-Encoding',
  'x-fastly-request-id': 'a0ea486a3d3316153b27bc07df6354052423df49'},
 'etag': 'W/"64ec33cf-736"',
 'updated': 'Mon, 28 Aug 2023 05:42:39 GMT',
 'updated_parsed': time.struct_time(tm_year=2023, tm_mon=8, tm_mday=28, tm_hour=5, tm_min=42, tm_sec=39, tm_wday=0, tm_yday=240, tm_isdst=0),
 'href': 'https://star77sa.github.io/index.xml',
 'status': 200,
 'encoding': 'utf-8',
 'version': 'rss20',
 'namespaces': {'': 'http://www.w3.org/2005/Atom',
  'media': 'http://search.yahoo.com/mrss/',
  'content': 'http://purl.org/rss/1.0/modules/content/',
  'dc': 'http://purl.org/dc/elements/1.1/'}}
feed['entries'][0]
{'title': 'Post With Code',
 'title_detail': {'type': 'text/plain',
  'language': None,
  'base': 'https://star77sa.github.io/index.xml',
  'value': 'Post With Code'},
 'authors': [{'name': 'Harlow Malloc'}],
 'author': 'Harlow Malloc',
 'author_detail': {'name': 'Harlow Malloc'},
 'links': [{'rel': 'alternate',
   'type': 'text/html',
   'href': 'https://star77sa.github.io/posts/post-with-code/index.html'}],
 'link': 'https://star77sa.github.io/posts/post-with-code/index.html',
 'summary': '<p>This is a post with executable code.</p>',
 'summary_detail': {'type': 'text/html',
  'language': None,
  'base': 'https://star77sa.github.io/index.xml',
  'value': '<p>This is a post with executable code.</p>'},
 'tags': [{'term': 'news', 'scheme': None, 'label': None},
  {'term': 'code', 'scheme': None, 'label': None},
  {'term': 'analysis', 'scheme': None, 'label': None}],
 'id': 'https://star77sa.github.io/posts/post-with-code/index.html',
 'guidislink': False,
 'published': 'Sat, 26 Aug 2023 15:00:00 GMT',
 'published_parsed': time.struct_time(tm_year=2023, tm_mon=8, tm_mday=26, tm_hour=15, tm_min=0, tm_sec=0, tm_wday=5, tm_yday=238, tm_isdst=0),
 'media_content': [{'url': 'https://star77sa.github.io/posts/post-with-code/image.jpg',
   'medium': 'image',
   'type': 'image/jpeg'}]}
random = numpy.random.randint(0, 30)

for i in feed['entries'][:7]:
    dt = datetime.datetime.strptime(i['published'], "%a, %d %b %Y %H:%M:%S %z").strftime("%b %d, %Y")
    markdown_text += f"[{i['title']}]({i['link']}) - {dt}<br>\n"
    print(i['link'], i['title'])
    markdown_text += ' '*random
random = numpy.random.randint(0, 30)
markdown_text = ""

for i in feed['entries'][:7]:
    dt = datetime.datetime.strptime(i['published'], "%a, %d %b %Y %H:%M:%S %Z").strftime("%b %d, %Y")
    markdown_text += f"[{i['title']}]({i['link']}) - {dt}<br>\n"
    print(i['link'], i['title'])
    markdown_text += ' '*random

markdown_text
https://star77sa.github.io/posts/post-with-code/index.html Post With Code
https://star77sa.github.io/posts/welcome/index.html Welcome To My Blog
'[Post With Code](https://star77sa.github.io/posts/post-with-code/index.html) - Aug 26, 2023<br>\n                             [Welcome To My Blog](https://star77sa.github.io/posts/welcome/index.html) - Aug 23, 2023<br>\n                             '
tistory_blog_url="https://ksko0424.tistory.com/"
feed = feedparser.parse(tistory_blog_url+"/rss")
import feedparser, datetime, numpy

tistory_blog_url="https://ksko0424.tistory.com/"
feed = feedparser.parse(tistory_blog_url+"/rss")
 
markdown_text = """
![header](https://capsule-render.vercel.app/api?type=waving&color=0000FF&height=250&section=header&text=Kyeongsoo%20Ko&fontColor=FFFFFF&fontSize=70&fontAlign=50)


- Name : 고경수         
- Email : star77sa@gmail.com 
- Education:
  - GIST M.S. in AI Graduate School
  - JBNU B.S. in Statistics & Computer Science Engineering (Double Major)
  
- Award:
  - 2023 위밋 프로젝트 교육부 장관상
  - 2022 데이터톤 경진대회 대상
  - 2022 전북대학교 통계학과 빅데이터 분석 경진대회 1회 최우수상
  - 2022 전북대학교 통계학과 빅데이터 분석 경진대회 2회 우수상
  - 2021 데이터 크리에이터 캠프 최우수상
  - 2021 성적우수 총장상

- Scholarships
  - 전북 차세대 과학인재 장학금
  - 국가우수장학(이공계)
  - 성적 우수 장학금 (2018-2, 2021-1)

- Work Experience:
  - JBNU CV Lab 인턴 (2023.02 ~ 2023.08)
  - GIST AI Lab 인턴 (2022.01 ~ 2022.02)
  
<!--
[![solved.ac tier](http://mazassumnida.wtf/api/v2/generate_badge?boj=star77sa)](https://solved.ac/star77sa)
-->

[![Notion Badge](https://img.shields.io/badge/Notion-000000?style=flat-square&title_bg=%235C5F64&logo=Notion&logo_color=%23F0F4F0&link=https://www.notion.so/ksko/Kyeongsoo-Ko-8383246d72ab463daba2b1f49f6486a1?pvs=4)](https://www.notion.so/ksko/Kyeongsoo-Ko-8383246d72ab463daba2b1f49f6486a1?pvs=4)
[![Tech Blog Badge](http://img.shields.io/badge/-Tech%20blog-black?style=flat-square&logo=github&link=https://ksko0424.tistory.com/)](https://ksko0424.tistory.com/)
[![Linkedin Badge](https://img.shields.io/badge/-LinkedIn-blue?style=flat-square&logo=Linkedin&logoColor=white&link=https://www.linkedin.com/in/%EA%B2%BD%EC%88%98-%EA%B3%A0-8b7781206/)](https://www.linkedin.com/in/%EA%B2%BD%EC%88%98-%EA%B3%A0-8b7781206/)
[![Gmail Badge](https://img.shields.io/badge/Gmail-d14836?style=flat-square&logo=Gmail&logoColor=white&link=mailto:star77sa@gmail.com)](mailto:star77sa@gmail.com)


- 🌱 I’m currently learning `Mathematical Statistics`, `Time Series Analysis`

<!--
[![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fstar77sa&count_bg=%234100EA&title_bg=%23555555&icon=github.svg&icon_color=%23E7E7E7&title=VIEW&edge_flat=false)](https://hits.seeyoufarm.com)
-->

<!--
**star77sa/star77sa** is a ✨ _special_ ✨ repository because its `README.md` (this file) appears on your GitHub profile.

Here are some ideas to get you started:

- 🔭 I’m currently working on ...
- 🌱 I’m currently learning ...
- 👯 I’m looking to collaborate on ...
- 🤔 I’m looking for help with ...
- 💬 Ask me about ...
- 📫 How to reach me: ...
- 😄 Pronouns: ...
- ⚡ Fun fact: ...
-->

## Recent blog posts
""" # list of blog posts will be appended here
 
random = numpy.random.randint(0, 30)

for i in feed['entries'][:7]:
    dt = datetime.datetime.strptime(i['published'], "%a, %d %b %Y %H:%M:%S %z").strftime("%b %d, %Y")
    markdown_text += f"[{i['title']}]({i['link']}) - {dt}<br>\n"
    print(i['link'], i['title'])
    markdown_text += ' '*random

f = open("README.md",mode="w", encoding="utf-8")
f.write(markdown_text)
f.close()