-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
237 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import yaml\n", | ||
"import os\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 12, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"14\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"file_path = '../app/configs/layout.yml'\n", | ||
"\n", | ||
"tab_name = None\n", | ||
"\n", | ||
"with open(file_path, 'r') as file:\n", | ||
"\tlayout = yaml.safe_load(file)\t \n", | ||
"\n", | ||
"\tfeed_widgets = []\n", | ||
"\tfor tab in layout['tabs']:\n", | ||
"\t\tfor column in tab['columns']:\n", | ||
"\t\t\tfor widget in column['widgets']:\n", | ||
"\t\t\t\tfeed_widgets.append(widget)\n", | ||
" \n", | ||
"print(len(feed_widgets))\t\t\t\t\t" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 14, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"{'name': \"Lawrence Person's BattleSwarm Blog\", 'type': 'feed', 'link': 'https://www.battleswarmblog.com/', 'url': 'https://www.battleswarmblog.com/?feed=rss2', 'column': 1, 'position': 1}\n", | ||
"{'name': 'Cafe Hayek', 'type': 'feed', 'link': 'https://cafehayek.com/', 'url': 'https://cafehayek.com/feed', 'filters': {'strip': [{'summary': '^Tweet\\\\s*\\\\.{0,3}|\\\\…\\\\s+'}]}}\n", | ||
"{'name': 'Slashdot', 'type': 'feed', 'summary_enabled': False, 'link': 'https://slashdot.org/', 'url': 'https://rss.slashdot.org/Slashdot/slashdotMain'}\n", | ||
"{'name': 'Bookmarks', 'type': 'bookmarks', 'bookmarks': [{'title': 'Cloudflare', 'url': 'https://www.cloudflare.com/'}, {'title': 'Codeword Generator', 'url': 'https://cxxr.github.io/nsa.js/'}, {'title': 'Gists', 'url': 'https://gist.github.com/'}, {'title': 'Github', 'url': 'https://github.com/ilude'}, {'title': 'MoneroOcean', 'url': 'https://moneroocean.stream/#/dashboard?addr=47JaiTVAxoujSKhibhmTS3hHaN8mW6Jfr46N1msSBsFhAyJj91KJ2maEk3DMf6gM9Ndmx81CqPAo41XPakFM3NTpUtn9dxL'}, {'title': 'Teams', 'url': 'https://teams.microsoft.com/'}, {'title': 'Tailscale', 'url': 'https://tailscale.com/'}, {'title': 'Thingiverse', 'url': 'https://www.thingiverse.com/'}]}\n", | ||
"{'name': 'AI', 'type': 'bookmarks', 'bookmarks': [{'title': 'BingGPT', 'url': 'https://www.bing.com/chat'}, {'title': 'ChatGPT', 'url': 'https://chat.openai.com/'}, {'title': 'ClaudeGPT', 'url': 'https://claude.ai/chats'}, {'title': 'GrokGPT', 'url': 'https://chat.grok.com/'}, {'title': 'PerplexityGPT', 'url': 'https://perplexity.ai/'}]}\n", | ||
"{'name': 'Shopping', 'type': 'bookmarks', 'bookmarks': [{'title': 'Ali Express', 'url': 'https://www.aliexpress.com/'}, {'title': 'Amazon', 'url': 'https://www.amazon.com/'}, {'title': 'Ebay', 'url': 'https://www.ebay.com/'}, {'title': 'Is There Any Deal', 'url': 'https://isthereanydeal.com/'}, {'title': 'Slickdeals', 'url': 'https://slickdeals.net/'}]}\n", | ||
"{'name': 'Real Clear Politics', 'type': 'feed', 'link': 'https://www.realclearpolitics.com/', 'url': 'https://www.realclearpolitics.com/index.xml'}\n", | ||
"{'name': 'Instapundit', 'type': 'feed', 'link': 'https://instapundit.com/', 'url': 'https://instapundit.com/feed/', 'column': 3, 'position': 1, 'filters': {'remove': [{'title': '#CommissionEarned'}, {'title': 'Open Thread'}]}}\n", | ||
"{'name': 'Twitchy', 'type': 'feed', 'link': 'https://twitchy.com/', 'url': 'https://twitchy.com/feed', 'column': 3, 'position': 2}\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"current_tab = layout['tabs'][0] if tab_name is None else next((tab for tab in layout['tabs'] if tab['name'].lower() == tab_name.lower()), layout['tabs'][0])\n", | ||
"for column in current_tab['columns']:\n", | ||
"\tfor widget in column['widgets']:\n", | ||
"\t\tprint(widget)" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.12.3" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
Oops, something went wrong.