Skip to content

Commit 3acb83e

Browse files
committed
Add 'iridescent-ivies/' from commit '9257b737610868357598e0a7c88d932df97df562'
git-subtree-dir: iridescent-ivies git-subtree-mainline: 59d3f5c git-subtree-split: 9257b73
2 parents 59d3f5c + 9257b73 commit 3acb83e

25 files changed

+4168
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# GitHub Action workflow enforcing our code style.
2+
3+
name: Lint
4+
5+
# Trigger the workflow on both push (to the main repository, on the main branch)
6+
# and pull requests (against the main repository, but from any repo, from any branch).
7+
on:
8+
push:
9+
branches:
10+
- main
11+
pull_request:
12+
13+
# Brand new concurrency setting! This ensures that not more than one run can be triggered for the same commit.
14+
# It is useful for pull requests coming from the main repository since both triggers will match.
15+
concurrency: lint-${{ github.sha }}
16+
17+
jobs:
18+
lint:
19+
runs-on: ubuntu-latest
20+
21+
env:
22+
# The Python version your project uses. Feel free to change this if required.
23+
PYTHON_VERSION: "3.12"
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
29+
- name: Set up Python ${{ env.PYTHON_VERSION }}
30+
uses: actions/setup-python@v5
31+
with:
32+
python-version: ${{ env.PYTHON_VERSION }}
33+
34+
- name: Run pre-commit hooks
35+
uses: pre-commit/action@v3.0.1

iridescent-ivies/.gitignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Files generated by the interpreter
2+
__pycache__/
3+
*.py[cod]
4+
5+
# Environment specific
6+
.venv
7+
venv
8+
.env
9+
env
10+
11+
# Unittest reports
12+
.coverage*
13+
14+
# Logs
15+
*.log
16+
17+
# PyEnv version selector
18+
.python-version
19+
20+
# Built objects
21+
*.so
22+
dist/
23+
build/
24+
uv.lock
25+
# IDEs
26+
# PyCharm
27+
.idea/
28+
# VSCode
29+
.vscode/
30+
# MacOS
31+
.DS_Store
32+
src/sql_bsky.egg-info/*
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: check-toml
6+
- id: check-yaml
7+
- id: end-of-file-fixer
8+
- id: trailing-whitespace
9+
args: [--markdown-linebreak-ext=md]
10+
11+
- repo: https://github.com/astral-sh/ruff-pre-commit
12+
rev: v0.12.2
13+
hooks:
14+
- id: ruff-check
15+
- id: ruff-format
16+
17+
- repo: https://github.com/astral-sh/uv-pre-commit
18+
rev: 0.8.8
19+
hooks:
20+
- id: pip-compile
21+
args: [
22+
"--universal",
23+
"--python-version=3.12",
24+
"pyproject.toml",
25+
"--group=dev",
26+
"-o",
27+
"requirements.txt"
28+
]

iridescent-ivies/LICENSE.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright 2021 Iridescent Ivies
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

iridescent-ivies/README.md

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
## The Social Query Language (SQL-BSky)
2+
3+
[![Python](https://img.shields.io/badge/Python-3.12+-blue.svg)](https://python.org)
4+
[![BlueSky](https://img.shields.io/badge/BlueSky-AT_Protocol-00D4FF.svg)](https://bsky.app)
5+
[![License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE.txt)
6+
[![Status](https://img.shields.io/badge/Status-Active-brightgreen.svg)]()
7+
8+
A retro terminal-style SQL interface for querying the BlueSky social network. Experience social media through the lens of structured query language with authentic CRT visual effects.
9+
10+
![App Initialization](assets/Init_sql_app.gif)
11+
12+
## Features
13+
14+
- **Dual Authentication**: Full BlueSky login or anonymous "stealth mode"
15+
- **Public API Access**: Query public content without authentication
16+
- **ASCII Art Images**: View embedded images as beautiful ASCII art
17+
- **Real-time Validation**: Live SQL syntax checking as you type
18+
- **Retro CRT Interface**: Authentic 1980s terminal experience with visual effects
19+
- **Fast Performance**: Optimized queries with scrolling support
20+
- **Easter Eggs**: Hidden surprises for the adventurous
21+
22+
## Quick Start
23+
24+
### Installation
25+
26+
1. Clone the repository:
27+
```bash
28+
git clone git@github.com:A5rocks/code-jam-12.git
29+
30+
# move to the dir
31+
cd code-jam-12
32+
```
33+
2. Start the development server:
34+
```bash
35+
python3 dev.py
36+
```
37+
38+
3. That's it! Open your browser to: [http://localhost:8000](http://localhost:8000)
39+
40+
### First Steps
41+
42+
1. **Choose Authentication Mode**:
43+
- **Authenticated**: Login with BlueSky credentials for full access
44+
- **Stealth Mode**: Browse public content anonymously
45+
46+
> [!NOTE]
47+
> If the page is slow, try disabling the CRT effect at this point.
48+
49+
2. **Try Your First Query**:
50+
```sql
51+
SELECT * FROM tables
52+
```
53+
54+
![Running Test Query](assets/run_test_query.gif)
55+
56+
3. **Explore Public Profiles**:
57+
```sql
58+
SELECT * FROM profile WHERE actor = 'bsky.app'
59+
```
60+
61+
## Query Reference
62+
63+
### Available Tables
64+
65+
| Table | Description | Auth Required | Parameters |
66+
|-------|-------------|---------------|------------|
67+
| `tables` | List all available tables | No | None |
68+
| `profile` | User profile information | No | `actor` (optional) |
69+
| `feed` | Posts from a specific user | No | `author` (required) |
70+
| `timeline` | Your personal timeline | Yes | None |
71+
| `suggestions` | Suggested users to follow | No | None |
72+
| `suggested_feed` | Recommended feeds | No | None |
73+
| `followers` | User's followers | No | `actor` (required) |
74+
| `following` | Who user follows | No | `actor` (required) |
75+
| `mutuals` | Mutual connections | No | `actor` (required) |
76+
| `likes` | User's liked posts | Yes | `actor` (required) |
77+
78+
### Example Queries
79+
80+
```sql
81+
SELECT * FROM feed WHERE author='bsky.app'
82+
```
83+
- This will get all fields from all posts from the author's feed
84+
85+
```sql
86+
SELECT description FROM followers WHERE author='bsky.app'
87+
```
88+
- This will get the bio of all followers of the author
89+
90+
```sql
91+
SELECT * FROM tables
92+
```
93+
- This will get all available table names
94+
95+
## Known Issues
96+
97+
> [!WARNING]
98+
> Please be aware of these current limitations before using the application.
99+
100+
> [!NOTE]
101+
> Queries to non-existent tables or fields will return empty rows instead of proper error messages.
102+
103+
**Example:**
104+
```sql
105+
-- Both of these return empty rows (same behavior)
106+
SELECT likes FROM feed WHERE author = "bsky.app"
107+
SELECT apples FROM feed WHERE author = "bsky.app"
108+
```
109+
110+
### KeyError in Feed Processing
111+
> [!IMPORTANT]
112+
> There's a known KeyError where the system looks for `"feeds"` but should be looking for `"feed"`. This is a human error we discovered after the Code Jam programming time had ended, so we weren't able to fix it, but we're aware of the issue and it may cause some like-table-related queries to fail unexpectedly.
113+
114+
##### Table `likes` Not Functional
115+
> [!CAUTION]
116+
> The `likes` table is currently broken and behaves like a non-existent table. This is due to the KeyError
117+
## Team - Iridescent Ivies
118+
119+
- **A5rocks** - [GitHub](https://github.com/A5rocks) (Team Leader)
120+
- **TheHeretic** - [GitHub](https://github.com/DannyTheHeretic)
121+
- **Walkercito** - [GitHub](https://github.com/Walkercito)
122+
- **Joshdtbx** - [GitHub](https://github.com/giplgwm)
123+
- **Mimic** - [GitHub](https://github.com/Drakariboo)
124+
125+
## License
126+
127+
This project is licensed under the MIT License - see the [LICENSE.txt](LICENSE.txt) file for details.
128+
129+
---
130+
131+
**Thank you for exploring our project!!**
11.3 MB
Loading
19.5 MB
Loading

iridescent-ivies/dev.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import http.server
2+
import os
3+
import socketserver
4+
import sys
5+
from pathlib import Path
6+
7+
# use src as start point
8+
src_dir = Path(__file__).parent / "src"
9+
if src_dir.exists():
10+
os.chdir(src_dir)
11+
print(f"[*] Serving from: {src_dir.absolute()}")
12+
else:
13+
print("[-] src/ dir not found")
14+
sys.exit(1)
15+
16+
PORT = 8000
17+
Handler = http.server.SimpleHTTPRequestHandler
18+
19+
try:
20+
with socketserver.TCPServer(("", PORT), Handler) as httpd:
21+
print(f"[*] Server running at: http://localhost:{PORT}")
22+
print(f"[*] Open: http://localhost:{PORT}/")
23+
print("[-] Press Ctrl+C to stop")
24+
httpd.serve_forever()
25+
except KeyboardInterrupt:
26+
print("\nServer stopped")
27+
except OSError as e:
28+
print(f"[-] Error: {e}")
29+
print("[-] Try a different port: python dev.py --port 8001")

iridescent-ivies/pyproject.toml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
[project]
2+
name = "sql-bsky"
3+
description = "Social query language"
4+
version = "0.1.0"
5+
readme = "README.md"
6+
requires-python = ">=3.12"
7+
dependencies = [
8+
"ascii-magic>=2.3.0",
9+
]
10+
11+
[dependency-groups]
12+
dev = [
13+
"pre-commit~=4.2.0",
14+
"ruff~=0.12.2",
15+
"pytest",
16+
]
17+
18+
[tool.ruff]
19+
line-length = 119
20+
target-version = "py312"
21+
fix = true
22+
src = ["src"]
23+
24+
[tool.ruff.lint]
25+
# Enable all linting rules.
26+
select = ["ALL"]
27+
# Ignore some of the most obnoxious linting errors.
28+
ignore = [
29+
# Missing docstrings.
30+
"D100",
31+
"D104",
32+
"D105",
33+
"D106",
34+
"D107",
35+
# Docstring whitespace.
36+
"D203",
37+
"D213",
38+
# Docstring punctuation.
39+
"D415",
40+
# Docstring quotes.
41+
"D301",
42+
# Builtins.
43+
"A",
44+
# Print statements.
45+
"T20",
46+
# TODOs.
47+
"TD002",
48+
"TD003",
49+
"FIX",
50+
# Conflicts with ruff format.
51+
"COM812",
52+
# Asserts are good, actually.
53+
"S101",
54+
]

iridescent-ivies/requirements.txt

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# This file was autogenerated by uv via the following command:
2+
# uv pip compile --universal --python-version=3.12 pyproject.toml --group=dev -o requirements.txt
3+
ascii-magic==2.3.0
4+
# via sql-bsky (pyproject.toml)
5+
cfgv==3.4.0
6+
# via pre-commit
7+
colorama==0.4.6
8+
# via
9+
# ascii-magic
10+
# pytest
11+
distlib==0.4.0
12+
# via virtualenv
13+
filelock==3.18.0
14+
# via virtualenv
15+
identify==2.6.12
16+
# via pre-commit
17+
iniconfig==2.1.0
18+
# via pytest
19+
nodeenv==1.9.1
20+
# via pre-commit
21+
packaging==25.0
22+
# via pytest
23+
pillow==11.3.0
24+
# via ascii-magic
25+
platformdirs==4.3.8
26+
# via virtualenv
27+
pluggy==1.6.0
28+
# via pytest
29+
pre-commit==4.2.0
30+
# via sql-bsky (pyproject.toml:dev)
31+
pygments==2.19.2
32+
# via pytest
33+
pytest==8.4.1
34+
# via sql-bsky (pyproject.toml:dev)
35+
pyyaml==6.0.2
36+
# via pre-commit
37+
ruff==0.12.8
38+
# via sql-bsky (pyproject.toml:dev)
39+
virtualenv==20.33.1
40+
# via pre-commit

0 commit comments

Comments
 (0)