https://github.com/its-me-nishmal/fun
https://github.com/its-me-nishmal/fun
actions ai automaion cd ci cipher ciphernichu nichu nodejs
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/its-me-nishmal/fun
- Owner: Its-me-nishmal
- Created: 2025-07-27T16:13:49.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-10-06T17:09:43.000Z (8 months ago)
- Last Synced: 2025-10-06T17:27:12.934Z (8 months ago)
- Topics: actions, ai, automaion, cd, ci, cipher, ciphernichu, nichu, nodejs
- Language: HTML
- Homepage: https://fun.nichu.dev
- Size: 1.43 MB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# π Cipher Nichu - AI-Generated Witty Answers β¨
[](https://nodejs.org/en/about/previous-releases)
[](https://opensource.org/licenses/MIT)
This project automatically generates unique, witty, and informative HTML pages based on common Google search queries, powered by AI. It's designed to be a fun and engaging way to explore everyday questions with a touch of humor and unexpected wisdom.
## β¨ Features & Capabilities
* π€ **AI-Powered Content Generation**: Leverages Google's Gemini API to create engaging and funny answers to user-generated topics.
* π **Automatic HTML Page Creation**: Generates standalone, semantic HTML5 pages with inline dark-themed CSS for a clean, minimalist look.
* π **SEO Optimized**: Each page includes relevant meta titles, descriptions, and keywords to improve searchability.
* π **Auto-Updating Sitemap**: Automatically generates and updates a `sitemap.xml` file to include all generated pages, ensuring discoverability.
* π¬ **Telegram Notifications**: Sends notifications to a specified Telegram chat whenever a new page is created.
* π **Topic Management**: Keeps track of generated topics to avoid repetition.
## π Getting Started & Setup
### π Prerequisites
* [Node.js](https://nodejs.org/) (version 18 or higher recommended)
### π οΈ Installation
1. πΏ Clone the repository:
```bash
git clone
cd fun
```
2. π¦ Install dependencies:
```bash
npm install
```
### π API Keys Configuration
This project requires API keys for Google Gemini and Telegram. These keys are stored in `config.js` and obfuscated using `obfuscator.js`.
1. π **Google Gemini API Key**:
* Obtain an API key from the [Google AI Studio](https://aistudio.google.com/).
* Obfuscate your API key using the `obfuscator.js` script (or manually encode it if you prefer).
* Update the `GEMINI_API_KEY` in `config.js`.
2. π€ **Telegram Bot Token and Chat ID**:
* Create a Telegram bot using [@BotFather](https://t.me/botfather) on Telegram to get your bot token.
* Find your Telegram Chat ID. You can get this by sending a message to your bot and then checking the Telegram Bot API documentation or using a bot like [@userinfobot](https://t.me/userinfobot).
* Obfuscate your bot token and chat ID.
* Update `TELEGRAM_BOT_TOKEN` and `TELEGRAM_CHAT_ID` in `config.js`.
**π‘ Example `config.js` (after obfuscation):**
```javascript
const { encode } = require('./obfuscator');
module.exports = {
GEMINI_API_KEY: "YOUR_OBFUSCATED_GEMINI_API_KEY",
TELEGRAM_BOT_TOKEN: "YOUR_OBFUSCATED_TELEGRAM_BOT_TOKEN",
TELEGRAM_CHAT_ID: "YOUR_OBFUSCATED_TELEGRAM_CHAT_ID",
};
```
## π‘ Usage & Workflow
To generate a new witty answer page:
1. βΆοΈ Run the script from your terminal:
```bash
node generate.js
```
Alternatively, you can use the npm script:
```bash
npm start
```
This will:
* π§ Fetch a new, unique question from the Gemini API.
* β¨ Generate an HTML page answering the question.
* πΎ Save the HTML file in the root directory (e.g., `how-to-make-coffee.html`).
* π Update the `index.html` with a link to the new page and increment the topic count.
* β
Add the topic to `completedTopics.json`.
* π’ Send a notification to your Telegram bot.
* πΊοΈ Generate/update `sitemap.xml`.
## π Project Structure Overview
* βοΈ `.env`: Environment variables (if used, though keys are in `config.js`).
* βοΈ `config.js`: Stores obfuscated API keys and configuration.
* π `generate.js`: The main script for generating content and pages.
* π `obfuscator.js`: Utility for encoding/decoding strings (used for API keys).
* β
`completedTopics.json`: Stores a list of topics already generated.
* π `index.html`: The main landing page listing all generated topics.
* π `*.html`: Dynamically generated pages for each topic.
* πΊοΈ `sitemap.xml`: An XML sitemap of all generated pages.
* π¦ `package.json`: Project metadata and dependencies.
* π« `.gitignore`: Specifies intentionally untracked files that Git should ignore.
## π License & Legal
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.