Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Thysrael/Horizon
/ functions
Functions
669 in github.com/Thysrael/Horizon
⨍
Functions
669
◇
Types & classes
97
↓ 1 callers
Method
_fetch_subreddit_html
( self, cfg: RedditSubredditConfig, since: datetime )
src/scrapers/reddit.py:167
↓ 1 callers
Method
_fetch_subreddit_rss
( self, cfg: RedditSubredditConfig, since: datetime )
src/scrapers/reddit.py:111
↓ 1 callers
Method
_fetch_user
( self, cfg: RedditUserConfig, since: datetime )
src/scrapers/reddit.py:284
↓ 1 callers
Method
_fetch_user_events
Fetch public events for a user. Args: username: GitHub username since: Only fetch events after this time Ret
src/scrapers/github.py:70
↓ 1 callers
Method
_fetch_watchlist
Fetch news for one watchlist via ``obb.news.company()``.
src/scrapers/openbb.py:116
↓ 1 callers
Method
_get_client
(self, index: int)
src/ai/client.py:563
↓ 1 callers
Method
_get_concurrency
Return the configured analysis concurrency, clamped to 1 or above.
src/ai/analyzer.py:38
↓ 1 callers
Method
_get_concurrency
Return the configured enrichment concurrency, clamped to 1 or above.
src/ai/enricher.py:33
↓ 1 callers
Function
_get_proxy
Resolve proxy from common env vars (PROXY, http_proxy, all_proxy).
src/scrapers/twitter_playwright.py:30
↓ 1 callers
Method
_get_throttle_sec
Return the configured inter-item throttle, clamped to zero or above.
src/ai/analyzer.py:32
↓ 1 callers
Method
_handle_response_status
Log and display HTTP response status by category. Even 2xx responses may contain platform-specific error codes in the JSON body (e.g.
src/services/webhook.py:653
↓ 1 callers
Function
_is_feishu_platform
Return whether platform should use Feishu/Lark card rendering.
src/services/webhook.py:137
↓ 1 callers
Function
_is_safe_markdown_link_url
Return True when a URL can be emitted as an active Markdown link.
src/ai/markdown_utils.py:38
↓ 1 callers
Method
_is_temperature_unsupported
(message: str)
src/ai/client.py:320
↓ 1 callers
Function
_listing_payload
()
tests/test_reddit.py:51
↓ 1 callers
Function
_load_browser_cookies
Read browser-exported cookie JSON and convert to Playwright format.
src/scrapers/twitter_playwright.py:42
↓ 1 callers
Function
_looks_like_api_key_value
(value: str)
src/ai/client.py:74
↓ 1 callers
Function
_main
()
scripts/check_mcp.py:14
↓ 1 callers
Method
_make_run_id
()
src/mcp/run_store.py:150
↓ 1 callers
Function
_make_test_items
Create sample ContentItems for the test notification.
src/services/webhook_cli.py:22
↓ 1 callers
Method
_make_title
(text: str)
src/scrapers/telegram.py:138
↓ 1 callers
Function
_make_two_subreddit_config
(fetch_comments: int = 0)
tests/test_reddit.py:27
↓ 1 callers
Method
_matches_keywords
Case-insensitive substring match against description, name, collections.
src/scrapers/ossinsight.py:144
↓ 1 callers
Function
_metrics_snapshot
()
src/mcp/server.py:121
↓ 1 callers
Function
_missing_api_key_message
(config: AIConfig)
src/ai/client.py:48
↓ 1 callers
Function
_normalize_ollama_base_url
(base_url: str)
src/ai/client.py:80
↓ 1 callers
Function
_old_comments_html
()
tests/test_reddit.py:107
↓ 1 callers
Method
_parse_channel_html
( self, html: str, cfg: TelegramChannelConfig, since: datetime )
src/scrapers/telegram.py:66
↓ 1 callers
Method
_parse_comment_count
(cls, thing: Any)
src/scrapers/reddit.py:269
↓ 1 callers
Method
_parse_date
Parse publication date from feed entry. Args: entry: Feed entry data Returns: datetime: Parsed publication d
src/scrapers/rss.py:121
↓ 1 callers
Method
_parse_date
Parse the publication date of an entry into aware UTC.
src/scrapers/google_news.py:189
↓ 1 callers
Method
_parse_event
Parse GitHub event into ContentItem. Args: event: GitHub event data username: GitHub username Returns:
src/scrapers/github.py:117
↓ 1 callers
Method
_parse_flair
(thing: Any)
src/scrapers/reddit.py:277
↓ 1 callers
Method
_parse_item
(self, item: dict, since: datetime)
src/scrapers/twitter.py:227
↓ 1 callers
Method
_parse_json_response
Try multiple strategies to extract a JSON object from an AI response. Returns the parsed dict, or None if all strategies fail.
src/ai/analyzer.py:25
↓ 1 callers
Method
_parse_message
( self, msg_el, channel: str, since: datetime )
src/scrapers/telegram.py:79
↓ 1 callers
Method
_parse_old_reddit_posts
( self, html: str, cfg: RedditSubredditConfig )
src/scrapers/reddit.py:197
↓ 1 callers
Method
_parse_old_reddit_timestamp
(thing: Any)
src/scrapers/reddit.py:243
↓ 1 callers
Method
_parse_post
( self, post: dict, comments: List[dict], subtype: str )
src/scrapers/reddit.py:444
↓ 1 callers
Method
_parse_rss_date
(entry: dict)
src/scrapers/reddit.py:353
↓ 1 callers
Method
_parse_seendate
Parse a GDELT ``seendate`` ("YYYYMMDDTHHMMSSZ") into aware UTC.
src/scrapers/gdelt.py:170
↓ 1 callers
Method
_parse_story
(self, story: dict, comments: List[dict])
src/scrapers/hackernews.py:100
↓ 1 callers
Method
_parse_tweet
Convert raw tweet dict to Horizon ContentItem.
src/scrapers/twitter_playwright.py:350
↓ 1 callers
Method
_pick_summary_stage
(self, run_id: str)
src/mcp/service.py:603
↓ 1 callers
Function
_preview_message
Render one dry-run preview using the same logic as the real sender.
src/services/webhook_cli.py:62
↓ 1 callers
Method
_raw_to_item
Map one OpenBB news record into a ContentItem. Returns None when the record is too old, has no URL, or fails validation. OpenBB retur
src/scrapers/openbb.py:137
↓ 1 callers
Method
_raw_to_item
Map one GDELT article record into a ContentItem. Returns None when the record has no URL/title or an unparseable ``seendate`` (publis
src/scrapers/gdelt.py:125
↓ 1 callers
Method
_resolve_base_url
(cls, config: AIConfig)
src/ai/client.py:226
↓ 1 callers
Function
_resolve_secrets_path
Resolve secrets config path via env and common locations.
src/mcp/horizon_adapter.py:315
↓ 1 callers
Method
_row_to_item
Convert a raw OSS Insight row into a ContentItem.
src/scrapers/ossinsight.py:80
↓ 1 callers
Function
_run_test
Execute the webhook test.
src/services/webhook_cli.py:87
↓ 1 callers
Method
_score_distribution
(items: list[Any])
src/mcp/service.py:621
↓ 1 callers
Method
_scrape_user
Scrape a single user's tweets via GraphQL interception.
src/scrapers/twitter_playwright.py:200
↓ 1 callers
Function
_search_for_item
(item: ContentItem)
src/search.py:75
↓ 1 callers
Method
_start_run
( self, token: str, users: List[str] )
src/scrapers/twitter.py:68
↓ 1 callers
Method
_strip_html
(value: str)
src/scrapers/reddit.py:371
↓ 1 callers
Function
_tag_matches_input
Check if a tag (or any of its aliases) matches the user input.
src/setup/presets.py:205
↓ 1 callers
Function
_text
Build a Feishu plain text object.
src/services/webhook.py:142
↓ 1 callers
Method
_time_operator
Build the Google News time operator from ``since``. Computes the number of whole hours between ``since`` and now (min 1). For windows
src/scrapers/google_news.py:113
↓ 1 callers
Method
_token_fallback_mode
(message: str)
src/ai/client.py:450
↓ 1 callers
Method
_total_fetched
(self, run_id: str, fallback: int)
src/mcp/service.py:613
↓ 1 callers
Function
_transform_api_response
Transform horizon-site API response to the internal preset format. The API returns data in horizon-site's format (Category enum IDs like "AI_
src/setup/presets.py:50
↓ 1 callers
Method
_try_import_obb
Try to import the OpenBB App, returning None if not installed. Importing ``openbb`` is expensive (loads every registered extension),
src/scrapers/openbb.py:60
↓ 1 callers
Method
_validate_config
Validate webhook URL configuration and print warnings for skip scenarios. Raises ValueError when URL is present but invalid. Sets sel
src/services/webhook.py:273
↓ 1 callers
Method
_validate_url
Validate webhook URL has a valid scheme (http/https) and hostname. Raises: ValueError: If the URL is empty, has wrong scheme, no h
src/services/webhook.py:240
↓ 1 callers
Method
_web_search
Search the web for context via DuckDuckGo. Returns: List of dicts with keys: title, url, body
src/ai/enricher.py:70
↓ 1 callers
Method
add_subscriber
Adds a new subscriber email.
src/storage/manager.py:132
↓ 1 callers
Function
build_config
Step 6: Assemble the final Config object. Args: ai_config: AI configuration. selected_sources: List of selected source dicts.
src/setup/wizard.py:191
↓ 1 callers
Function
configure_ai
Step 1: Configure AI provider. Returns: AIConfig if configured, None if user skips.
src/setup/wizard.py:44
↓ 1 callers
Function
dicts_to_items
Deserialize ContentItem list.
src/mcp/horizon_adapter.py:249
↓ 1 callers
Function
fetch_presets
Fetch presets from the horizon-site API. Returns: Dict in the internal preset format (with "domains" key), or None if the fetch f
src/setup/presets.py:25
↓ 1 callers
Function
get_ai_recommendations
Ask AI to recommend additional sources beyond presets. Args: ai_config: AI configuration for creating the client. interests: User
src/setup/ai_recommend.py:12
↓ 1 callers
Function
get_ai_recommendations_sync
Synchronous wrapper for get_ai_recommendations.
src/setup/ai_recommend.py:64
↓ 1 callers
Method
get_effective_config
Return effective config after optional source filtering.
src/mcp/service.py:140
↓ 1 callers
Function
get_interests
Step 2: Get user's interest description. Returns: Free-form interest string.
src/setup/wizard.py:112
↓ 1 callers
Function
get_tag_aliases
Return all aliases for a canonical tag (empty list if unknown).
src/setup/tag_aliases.py:111
↓ 1 callers
Function
get_usage_snapshot
Return a snapshot of accumulated token usage.
src/ai/tokens.py:53
↓ 1 callers
Function
load_presets
Load presets from API (preferred) or local file (fallback). Args: presets_path: Path to the local presets JSON file for fallback.
src/setup/presets.py:101
↓ 1 callers
Function
main
Main CLI entry point.
src/main.py:34
↓ 1 callers
Function
main
CLI entry point for horizon-webhook.
src/services/webhook_cli.py:157
↓ 1 callers
Function
main
Run MCP server over stdio.
src/mcp/server.py:497
↓ 1 callers
Function
markSemanticElements
Add semantic classes to tag lines, source lines, and background paragraphs
docs/assets/js/horizon.js:25
↓ 1 callers
Function
match_sources
Match user interest description against individual sources. Scores each source based on: - Category keyword matches (+1.0 per keyword) -
src/setup/presets.py:217
↓ 1 callers
Function
merge_configs
Merge new config into existing config, deduplicating sources. Rules: - ai / filtering: use new values (full replacement) - sources: dedup
src/setup/wizard.py:294
↓ 1 callers
Function
print_banner
Print the application banner.
src/main.py:18
↓ 1 callers
Function
print_banner
Print the setup wizard banner.
src/setup/wizard.py:28
↓ 1 callers
Function
processScoreBadges
Replace ⭐️ N/10 with a colored badge in h2, h3, and li elements
docs/assets/js/horizon.js:5
↓ 1 callers
Method
remove_subscriber
Removes a subscriber email.
src/storage/manager.py:139
↓ 1 callers
Method
run_pipeline
( self, hours: int = 24, languages: list[str] | None = None, threshold: float
src/mcp/service.py:487
↓ 1 callers
Method
save_config
Save configuration to config.json, optionally backing up the existing file. Args: config: The Config object to save.
src/storage/manager.py:92
↓ 1 callers
Function
search_hn
Search HN Algolia. Returns list of {title, url, source, score, num_comments, date}.
src/search.py:16
↓ 1 callers
Function
search_reddit
Search Reddit JSON API. Returns list of {title, url, source, score, num_comments, subreddit, date}.
src/search.py:39
↓ 1 callers
Function
select_sources
Step 5: Interactive source selection with a rich table. Args: preset_sources: Sources matched from presets. ai_sources: Sources r
src/setup/wizard.py:129
↓ 1 callers
Method
send_webhook
Send a webhook notification using the configured webhook settings.
src/mcp/service.py:637
↓ 1 callers
Function
setupLanguageToggle
Set up EN/中文 language toggle as a page-level control
docs/assets/js/horizon.js:45
↓ 1 callers
Function
switchArticleLang
(lang)
docs/assets/js/horizon.js:95
Method
__call__
(self, cfg)
tests/test_chained_client.py:35
Method
__enter__
(self)
tests/test_email.py:17
Method
__exit__
(self, exc_type, exc, tb)
tests/test_email.py:20
Method
__init__
Initialize orchestrator. Args: config: Application configuration storage: Storage manager
src/orchestrator.py:48
← previous
next →
201–300 of 669, ranked by callers