- Rebuilt the CLI importer to use the official Facebook Graph API instead of HTML scraping.

Main changes:
Replaced 
[scripts/facebook-events-import.php](/Users/tyemeclifford/Documents/GH/MyKeyser/scripts/facebook-events-import.php) 
with a Graph API client.
It now supports --page-id, --pages-file, --event-id, --events-file, and 
optional area discovery via --discover-pages --center=LAT,LNG 
--query=....
Uses FACEBOOK_GRAPH_ACCESS_TOKEN or --access-token.
Pulls Graph fields for title, description, start/end time, 
place/location, ticket URI, and cover.source for the main photo.
Keeps the existing staged review/import workflow in 
/admin/event_imports.php.

- Implemented event detail pages and clickable event cards.
What changed:
Added [event.php](/Users/tyemeclifford/Documents/GH/MyKeyser/event.php) 
for individual event pages.
Made event cards clickable from 
[events.php](/Users/tyemeclifford/Documents/GH/MyKeyser/events.php), 
[index.php](/Users/tyemeclifford/Documents/GH/MyKeyser/index.php), and 
legacy 
[2index.php](/Users/tyemeclifford/Documents/GH/MyKeyser/2index.php).
Added large event photo display plus lightbox enlargement in 
[assets/css/style.css](/Users/tyemeclifford/Documents/GH/MyKeyser/assets/css/style.css) 
and 
[assets/js/app.js](/Users/tyemeclifford/Documents/GH/MyKeyser/assets/js/app.js).
Added eventUrl() and externalHref() helpers in 
[includes/functions.php](/Users/tyemeclifford/Documents/GH/MyKeyser/includes/functions.php).
Added copy-event-link support on event detail pages.
Updated README to list the new route.
This commit is contained in:
Ty Clifford
2026-06-19 18:07:45 -04:00
parent d83b62b79c
commit 354bb4255d
13 changed files with 1455 additions and 9 deletions
+18
View File
@@ -69,11 +69,24 @@ php -S localhost:8080
- **Alerts** — post/manage business announcements
- **Attractions** — full CRUD for attractions
- **Events** — approve/reject submissions, add events, feature events
- **Event Imports** — review Facebook event candidates staged by the CLI importer
- **Users** — add/edit/delete users, reset passwords, suspend accounts
- **Assign Owners** — link users to businesses for self-management
- **Reports** — review and close user-submitted listing corrections
- **Settings** — toggle registration on/off, event approval, change admin password
### Facebook Event Import Workflow
Stage Facebook event candidates from the official Facebook Graph API, then review and import them from Admin -> Event Imports:
```bash
FACEBOOK_GRAPH_ACCESS_TOKEN=... php scripts/facebook-events-import.php --area="Keyser, WV" --page-id=123456789 --limit=20
php scripts/facebook-events-import.php --access-token=... --event-id=123456789012345
php scripts/facebook-events-import.php --access-token=... --area="Keyser, WV" --center=39.4364,-78.9762 --distance=25000 --query="Keyser" --discover-pages
```
The importer does not scrape Facebook, log in, or bypass access controls. Your Meta app/token must have permission to read the requested Page/Event data through Graph API.
---
## FILE STRUCTURE
@@ -86,6 +99,7 @@ keyser-wv/
├── menu.php # Owner menu manager
├── attractions.php # Attractions page
├── events.php # Events calendar + submission
├── event.php # Event detail page
├── about.php # About Keyser WV history
├── login.php # Login
├── register.php # Registration
@@ -95,6 +109,7 @@ keyser-wv/
├── includes/
│ ├── boot.php # Bootstrap (session + DB init)
│ ├── db.php # Database, schema, seed data
│ ├── facebook_event_importer.php # Facebook event parser/import helpers
│ ├── functions.php # Auth, helpers, CSRF, stars
│ ├── header.php # HTML header + navbar
│ └── footer.php # Footer + JS
@@ -107,10 +122,13 @@ keyser-wv/
│ ├── alerts.php # Manage alerts
│ ├── attractions.php # Manage attractions
│ ├── events.php # Manage events
│ ├── event_imports.php # Review staged Facebook event imports
│ ├── users.php # Manage users
│ ├── owners.php # Assign owners to businesses
│ ├── reports.php # Handle listing reports
│ └── settings.php # Site settings + password
├── scripts/
│ └── facebook-events-import.php # CLI Facebook event stager
├── assets/
│ ├── css/style.css # Complete dark WV theme
│ └── js/app.js # Nav, dropdowns, confirm dialogs