Skip to content

Commit

Permalink
Update the README (#8)
Browse files Browse the repository at this point in the history
* Update the README
* Bump the cron schedule by an hour
* Make content credits italic
  • Loading branch information
fabritsius committed Nov 19, 2022
1 parent e774950 commit 4efedaf
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/post-an-article.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Post an Article

on:
schedule:
- cron: "0 4 * * *"
- cron: "0 5 * * *"
workflow_dispatch:
inputs:
date:
Expand Down
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
# Wikipedia POTD Telegrapher
![POTD Telegrapher](https://fabritsius.github.io/potd-telegrapher/img/potd-banner.jpg)

This project gets Wikipedia's Picture of the Day and publishes it on the [Telegram Channel](https://t.me/w_potd).
This project gets [Wikipedia's Picture of the Day](https://en.wikipedia.org/wiki/Wikipedia:Picture_of_the_day) and publishes it on the [Telegram Channel](https://t.me/w_potd).

### Progress
### How it works?

- [x] Add POTD parser
- [x] Add [telegra.ph](https://telegra.ph/) publisher
- [x] Add Telegram Bot which does the publishing daily
- [x] Add a daily action for posting
- [ ] Update the README with future plans
- Get the content from [Wikipedia](https://en.wikipedia.org/wiki/Wikipedia:Picture_of_the_day)
- Create a [telegra.ph](https://telegra.ph/) article
- Post an article link to the [Telegram Channel](https://t.me/w_potd)
- A **cron** job is launched every day which does all of the above

### Roadmap

- [x] Release 1.0.0
- [ ] Add an action that only creates an article
- [ ] Use the Wiki API instead of web scraping (potentially)
- [ ] Preserve all of Wikipedia's links (potentially)
- [ ] Additionally send an article to Instagram
Binary file added docs/img/potd-banner.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion src/telegraph/telegraph.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func fillPage(wikiPage *wikipedia.POTD) (TelegraphPage, error) {

page.AddImg(wikiPage.Img)
page.AddText(wikiPage.Content)
page.AddText(fmt.Sprintf("Credits: %s", wikiPage.Credits))
page.AddItalic(fmt.Sprintf("Credits: %s", wikiPage.Credits))

return page, nil
}
Expand All @@ -84,6 +84,13 @@ func (page *TelegraphPage) AddText(text string) {
})
}

func (page *TelegraphPage) AddItalic(text string) {
page.addContent(Node{
Tag: "i",
Children: []string{text},
})
}

func (page *TelegraphPage) AddImg(src string) {
node := Node{
Tag: "img",
Expand Down

0 comments on commit 4efedaf

Please sign in to comment.