[PR #81] [MERGED] Add authentication and upvote support #91

Closed
opened 2026-03-14 12:31:45 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/aome510/hackernews-TUI/pull/81
Author: @aome510
Created: 11/15/2022
Status: Merged
Merged: 1/30/2023
Merged by: @aome510

Base: mainHead: add-upvote-support


📝 Commits (10+)

  • 2ad1eb9 upvote kinda works
  • 031aaee fix clippy errors
  • a37555a implement authentication from file
  • 2eaa7e9 WIP: convert to parse all vote links from story page
  • 07b26b9 add function for constructing hashmap of 'id->(auth, vote status)'
  • 1723015 store StoryData inside the story comment view
  • 13db2b5 tweak StoryData fields' documentation
  • 0e3b595 add vote command
  • 05192f1 rename HnText to HnItem
  • c39c4f1 implement simple upvote mechanism

📊 Changes

10 files changed (+355 additions, -176 deletions)

View changed files

📝 Cargo.lock (+136 -140)
📝 hackernews_tui/Cargo.toml (+4 -1)
📝 hackernews_tui/src/client/mod.rs (+117 -6)
📝 hackernews_tui/src/client/parser.rs (+7 -7)
📝 hackernews_tui/src/config/keybindings.rs (+4 -0)
📝 hackernews_tui/src/config/mod.rs (+20 -2)
📝 hackernews_tui/src/main.rs (+35 -2)
📝 hackernews_tui/src/view/async_view.rs (+2 -2)
📝 hackernews_tui/src/view/comment_view.rs (+28 -10)
📝 hackernews_tui/src/view/text_view.rs (+2 -6)

📄 Description

Note: the voting/authentication is not ready yet. This PR is just a first iteration of the feature.

Changes

  • added support for voting and authentication functionalities
    • enabled cookies feature for ureq (HTTP client)
    • implemented HNClient::vote and HNClient::login functions and related helper functions

TODOs (for follow-up PR)

  • update README to add entries for authentication and voting commands
  • add visualization (view) for votes

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/aome510/hackernews-TUI/pull/81 **Author:** [@aome510](https://github.com/aome510) **Created:** 11/15/2022 **Status:** ✅ Merged **Merged:** 1/30/2023 **Merged by:** [@aome510](https://github.com/aome510) **Base:** `main` ← **Head:** `add-upvote-support` --- ### 📝 Commits (10+) - [`2ad1eb9`](https://github.com/aome510/hackernews-TUI/commit/2ad1eb93d7bbe4cc27332965e840a5bf8fc9c1b0) upvote kinda works - [`031aaee`](https://github.com/aome510/hackernews-TUI/commit/031aaee333e92aa364f5442d3240946562471988) fix clippy errors - [`a37555a`](https://github.com/aome510/hackernews-TUI/commit/a37555a50c06dc8d1286ae3a6cc63595b4bc60b1) implement authentication from file - [`2eaa7e9`](https://github.com/aome510/hackernews-TUI/commit/2eaa7e9c0c752c9546175acd319d2ae9ec9f06d4) WIP: convert to parse all vote links from story page - [`07b26b9`](https://github.com/aome510/hackernews-TUI/commit/07b26b91506833d4493780054d5a947dc8362785) add function for constructing hashmap of 'id->(auth, vote status)' - [`1723015`](https://github.com/aome510/hackernews-TUI/commit/172301506159efcde018930ff4b23132f10cbf41) store `StoryData` inside the story comment view - [`13db2b5`](https://github.com/aome510/hackernews-TUI/commit/13db2b55a6690e3a6e2acb848bc20b4f769bd441) tweak `StoryData` fields' documentation - [`0e3b595`](https://github.com/aome510/hackernews-TUI/commit/0e3b59572b9d0f258c4c1bb0e702563ded99b5d8) add `vote` command - [`05192f1`](https://github.com/aome510/hackernews-TUI/commit/05192f1a55ae4cb21a51e6c42286f5baa4651dbe) rename `HnText` to `HnItem` - [`c39c4f1`](https://github.com/aome510/hackernews-TUI/commit/c39c4f11a39f2724e2c3d32dec5f95b121f5662e) implement simple upvote mechanism ### 📊 Changes **10 files changed** (+355 additions, -176 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+136 -140) 📝 `hackernews_tui/Cargo.toml` (+4 -1) 📝 `hackernews_tui/src/client/mod.rs` (+117 -6) 📝 `hackernews_tui/src/client/parser.rs` (+7 -7) 📝 `hackernews_tui/src/config/keybindings.rs` (+4 -0) 📝 `hackernews_tui/src/config/mod.rs` (+20 -2) 📝 `hackernews_tui/src/main.rs` (+35 -2) 📝 `hackernews_tui/src/view/async_view.rs` (+2 -2) 📝 `hackernews_tui/src/view/comment_view.rs` (+28 -10) 📝 `hackernews_tui/src/view/text_view.rs` (+2 -6) </details> ### 📄 Description **Note**: the voting/authentication is not ready yet. This PR is just a first iteration of the feature. ## Changes - added support for voting and authentication functionalities - enabled `cookies` feature for `ureq` (HTTP client) - implemented `HNClient::vote` and `HNClient::login` functions and related helper functions ## TODOs (for follow-up PR) - [ ] update README to add entries for authentication and voting commands - [ ] add visualization (view) for votes --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-14 12:31:45 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hackernews-TUI#91
No description provided.