Commit Graph

16 Commits

Author SHA1 Message Date
986360f7d5 feat: Add URL normalization and inline audit sections
- Add normalize_social_url() function to database.py to prevent
  www vs non-www duplicates in social media records
- Update update_social_media.py to normalize URLs before insert
- Update social_media_audit.py to normalize URLs before insert
- Add inline GBP Audit section to company profile
- Add inline Social Media Audit section to company profile
- Add inline IT Audit section to company profile

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 23:07:03 +01:00
b4dcca6d55 auto-claude: 2.3 - Replace hardcoded password in scripts/social_media_audit.py with safe fallback 2026-01-10 12:50:39 +01:00
39cd257f4e Fix YouTube detection overwriting valid matches
- Add 'channel', 'c', 'user', '@' etc. to YouTube exclusion list
- Add 'bold_themes', 'boldthemes' to Twitter/Facebook exclusions (theme creators)
- Fix pattern matching loop to stop after first valid match per platform
- Prevents fallback pattern from overwriting correct channel ID with 'channel'

Fixes issue where youtube.com/channel/ID was being overwritten with
youtube.com/channel/channel by the second fallback pattern.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 05:36:06 +01:00
c319777d58 Social Media audit: progress bar improvements
- Add detailed logging to SocialMediaAuditor (website scan, Brave search, results)
- Slow down progress bar animation (400ms instead of 200ms) for better readability
- Bold "ZNALEZIONO" text for found platforms
- Display Google rating and review count in progress
- Increase wait time before modal close (4 seconds)
- Add console.log for debugging audit response

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 05:29:17 +01:00
8fed190303 fix(social-audit): Convert opening_hours dict to JSON for JSONB column
Fixes: psycopg2.ProgrammingError: can't adapt type 'dict'

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 05:14:01 +01:00
5ed97ac1dd auto-claude: subtask-5-1 - Fix opening_hours and photos data passing in audit_company
Fixed a bug where google_opening_hours and google_photos_count were being
fetched from the Google Places API but not passed through to the result
dictionary correctly:

- Changed 'opening_hours' key to 'google_opening_hours' to match what
  save_audit_result() expects
- Added 'google_photos_count' to the result dictionary

Verified with dry-run: INPI company now shows opening hours schedule
and 10 photos count from Google Business Profile.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 23:08:19 +01:00
aacf2cf54b auto-claude: subtask-2-3 - Update save_audit_result() to store google_opening_hours and google_photos_count
- Added google_opening_hours and google_photos_count to INSERT column list
- Added corresponding placeholders to VALUES list
- Added to ON CONFLICT UPDATE SET clause
- Added to parameter dictionary reading from google_reviews result

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 23:00:22 +01:00
5f2cfa06fd auto-claude: subtask-2-2 - Update get_place_details() to return photos count
- Add google_photos_count to result dictionary initialization
- Extract photos count from API response using len(place['photos'])
- Update logging to include photos count in output

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 22:59:04 +01:00
5fa80f9efa auto-claude: subtask-2-1 - Add 'photos' to fields list in GooglePlacesSearcher
Added 'photos' field to the fields list in get_place_details() method
to enable fetching business photos from Google Places API.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 22:58:04 +01:00
06c22539d7 auto-claude: subtask-4-2 - Add --company-slug support and dotenv loading
- Add --company-slug argument to social_media_audit.py for easier testing
- Add get_company_id_by_slug() method to SocialMediaAuditor class
- Add python-dotenv support to load .env file from project root
- Create verify_google_places.py script for direct API testing

Note: Full verification blocked - current API key (PageSpeed) doesn't have
Places API enabled. Requires enabling Places API in Google Cloud Console
for project NORDABIZNES (gen-lang-client-0540794446).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 20:49:59 +01:00
3d69d53550 auto-claude: subtask-3-4 - Run all tests and verify they pass
Fixed bug in social media exclusion logic that was too aggressive.
The substring check `any(ex in match.lower() for ex in excludes)`
was incorrectly excluding valid usernames containing exclusion
strings (e.g., 'testcompany' was excluded because it contained 'p').

Changed to exact match only to properly handle Instagram post URLs
(`instagram.com/p/...`) without false positives on valid usernames.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 20:41:54 +01:00
3bdbde1621 auto-claude: subtask-2-3 - Update SocialMediaAuditor to use GooglePlacesSearcher
- Add google_places_searcher attribute to SocialMediaAuditor
- Initialize GooglePlacesSearcher if GOOGLE_PLACES_API_KEY env var is set
- Update audit_company() to use Places API directly when available
- Fallback to Brave Search when API key not configured
- Log which data source is being used for reviews

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 20:31:22 +01:00
b389287697 auto-claude: subtask-2-2 - Replace placeholder search_google_reviews() method
Implemented actual Google reviews data collection in BraveSearcher class:
- Uses GooglePlacesSearcher to find company and get place details
- Returns google_rating, google_reviews_count, opening_hours, business_status
- Falls back to Brave Search API parsing when Google API key not available
- Added _search_brave_for_reviews() helper for fallback implementation
- Proper error handling and logging throughout

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 20:29:50 +01:00
4110ef63b5 auto-claude: subtask-2-1 - Add GooglePlacesSearcher class to social_media_audit.py
Implements GooglePlacesSearcher class with:
- find_place() method: searches for business by name and city
  using Google Places findplacefromtext API
- get_place_details() method: retrieves rating, review count,
  opening hours, business status, phone, and website

Features:
- Uses GOOGLE_PLACES_API_KEY environment variable
- Comprehensive error handling (timeout, request errors)
- Polish language locale support
- Follows existing BraveSearcher class pattern

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 20:27:49 +01:00
af003798a7 Napraw połączenie z bazą danych w skryptach SEO (localhost zamiast zewnętrznego IP) 2026-01-08 15:57:39 +01:00
02fc67bf40 Initial commit 2026-01-01 14:01:49 +01:00