Skip to content

feat: Add multi-provider stock website support #34

Merged
alichtman merged 11 commits intofacebook:mainfrom
byuly:feat-stock-config
Mar 2, 2026
Merged

feat: Add multi-provider stock website support #34
alichtman merged 11 commits intofacebook:mainfrom
byuly:feat-stock-config

Conversation

@byuly
Copy link
Contributor

@byuly byuly commented Feb 7, 2026

#32 adds support for multiple stock website providers!

feat details:

  • Users can now set their preferred stock provider in ~/.config/bunnylol/config.toml
  • Users can override the config default through command (bunnylol stock finviz META -> will override default config to finviz)
  • Global config accessed via get_global_config()

testing:

  • default behavior
  • each provider mixed (yahoo, finviz, tradingview, google, investing)
  • config-based defaults
  • subcommand overrides beating config
  • $TICKER syntax with config
  • special character handling
  • + manual testing

nitpicks are welcome too, just starting to learn with rustlings and figured ill jump into a open source repo :) any feedback is appreciated!

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 7, 2026
Copy link
Contributor

@alichtman alichtman left a comment

Choose a reason for hiding this comment

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

This is a great start! A few comments on things that stood out to me.

@byuly
Copy link
Contributor Author

byuly commented Feb 9, 2026

appreciate the review! i'll address these in a few days, just leaving this comment to let you know i'm not leaving this stale

@byuly byuly requested a review from alichtman February 13, 2026 08:31
@byuly byuly requested a review from alichtman March 2, 2026 01:27
@byuly
Copy link
Contributor Author

byuly commented Mar 2, 2026

@alichtman thanks for all the reviewing and suggestions! looks a lot cleaner this way. I apologize for being slow with the iteration.. please review when you have the time :)

log_level = "{}"
{}
"#,
if let Some(browser) = &self.browser {
Copy link
Contributor

Choose a reason for hiding this comment

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

I regret not extracting this logic to a variable -- it's kinda hard to read. I'll fix that in a future commit

@@ -23,6 +38,12 @@
#[serde(default = "default_search_engine")]
Copy link
Contributor

@alichtman alichtman Mar 2, 2026

Choose a reason for hiding this comment

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

This should probably be default = "google" and stock_provider below should probably be default = "yahoo", and non-optional

let encoded_query =
percent_encoding::utf8_percent_encode(query, percent_encoding::NON_ALPHANUMERIC)
.to_string();
let encoded_query = encode_url_special_char(query);
Copy link
Contributor

@alichtman alichtman Mar 2, 2026

Choose a reason for hiding this comment

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

IN retrospect, this function probably should have been internal to some kind of search command / module, instead of inlined in the config file

@alichtman alichtman merged commit 4799c5c into facebook:main Mar 2, 2026
4 checks passed
@alichtman
Copy link
Contributor

Thanks for putting this PR together!

@byuly byuly deleted the feat-stock-config branch March 2, 2026 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants