A Python-based GUI application that searches for and analyzes potential negative news about customers using Google Custom Search API and sentiment analysis.
- Custom Google search with specified keywords
Multi-languageandcustom search keywordssupport- Configurable languages, keywords, exclusions and more using json based config
- Sentiment analysis of search results
- Risk
scoringandcategorizationbased onSentiment scoresfor each result - Interactive GUI with Raw JSON response viewer
- Automatic browser opening for high-risk results
- Uses
Curl CFFIfor access to all kinds of URLs - Support Parsing of PDF and DOCx files in URLs
- Python 3.x
- Google Custom Search API credentials
- Internet connection
- Binary Release
- Make sure config.json is in application root
-
Clone the repository
git clone https://github.com/aamitn/negative-news
-
Install required dependencies:
pip install -r requirements.txt
-
Set up Google Custom Search API:
-
Create Custom Search Engine:
- Visit CSE Creation Page or Programmable Search Engine
- Create your search engine
- Note down the CX/Search engine ID
-
Get API Key (choose one method):
- Method A:
- Go to Custom Search API Overview
- Click "Get a Key"
- Method B:
- Visit Google Cloud Console
- Enable Custom Search API
- Go to Credentials
- Click "CREATE CREDENTIALS"
- Select "API key"
- Copy your API key
- Method A:
-
-
Configure Application:
- Create
config.jsonin project root - Add your API credentials creted in step 3
- Create
Create a config.json file in the project root with the following structure:
{
"google_search_api_key": "YOUR_GOOGLE_SEARCH_API_KEY",
"google_search_cx": "YOUR_GOOGLE_CUSTOM_SEARCH_CX",
"pdf_max_pages": 5,
"docx_max_paragraphs" : 50,
"max_chars" : 1000,
"total_results": 10,
"connection_timeout":5,
"read_timeout": 5,
"max_retries": 2,
"curl_cffi_impersonator": "chrome",
"languages_keywords": {
"English": ["bribery", "fraud", "money laundering", "crime", "terrorism", "corruption"],
"Spanish": ["soborno", "fraude", "lavado de dinero", "crimen", "terrorismo", "corrupción"],
"yourlang":["custom_key1","key2"]
},
"default_selected_languages": ["English"],
"excluded_sites": ["facebook.*", "twitter.*", "instagram.*", "linkedin.*", "reddit.*"]
}- Run the application:
python app.py- Enter the customer name in the search field
- Select the desired languages for search
- Click "Search and Analyze"
- View results in the Analysis Results tab
- Check raw API responses in the Raw Response tab
pyinstaller --noconfirm --onefile --windowed --icon "C:\Users\bigwiz\PycharmProjects\negative-news\assets\logo.ico" "C:\Users\bigwiz\PycharmProjects\negative-news\app.py"- SSL Certificate issues: The application uses a local
cacert.pemfile for SSL verification - If you encounter connection issues, check your internet connection and API credentials
- Ensure all required Python packages are installed correctly

