This bot will send you images from NASA's website to telegram-chat
- Open Telegram
- Search for
JAVA_NASA_apod_downloaderor click the link
- Enter
/start
- Follow the marker in bot to get image from Nasa website.
- So here are un example of bot's work
- Also there are link to pictures:
HD_picture
Basic definition picture
- Clone this repository
- Create your_bot_token with BotFather - using telegram-bot for these aims
- Create dir
.envwhich have to contain these lines:API_KEY is for NASA_URLBOT_TOKEN=YOUR_BOT_TOKEN API_KEY=meXuPit01arAzczsziwyU97LKABrdqxjYWmoy8e9 - Build project
- And ... run the application to start a bot
-
Register on Yandex Cloud:
- Visit Yandex Cloud and sign up for an account.
-
Connect to Yandex Cloud:
- Press the "Подключиться" (Connect) button on the Yandex Cloud dashboard.
-
Add Payment Method for Trial Period:
- Add a payment method to activate the trial period (4000 ₽). Ensure your card has at least 11 ₽ for verification.
-
Create a Virtual Machine (VM):
- Navigate to All Services -> Computer Cloud -> New VM.
- Select Ubuntu 20.04 with minimal characteristics (our virtual service doesn't need high power).
-
Generate SSH Key:
- Open your terminal and enter the command:
ssh-keygen -t rsa
- For more information on generating SSH keys, visit this tutorial.
- Copy the public key (save it in a
.txtfile).
- Open your terminal and enter the command:
-
Wait for VM Status:
- Wait until the VM status turns green and shows "Running".
-
Access the VM via SSH:
- Open your terminal and use the command:
ssh {username}@{public IPv4} - Confirm with (Y) to establish the connection.
- Open your terminal and use the command:
-
Work in Ubuntu Environment:
- From this point, you will be working in the terminal within the Ubuntu environment. Use Linux commands.
-
Check Java Version:
- Verify the installed Java version with:
java --version
- Verify the installed Java version with:
-
Install Java:
- Update the package list:
sudo apt update
- Install Java 17 (or the required version):
sudo apt install openjdk-17-jdk
- Update the package list:
-
Upgrade Packages:
- Upgrade the installed packages:
sudo apt upgrade
- Upgrade the installed packages:
-
Verify Java Version Again:
- Check the Java version:
java --version
- Check the Java version:
-
Configure Your Project in IntelliJ IDEA:
- Open IntelliJ IDEA and go to the
pom.xmlfile (project configuration).
- Open IntelliJ IDEA and go to the
-
Update
pom.xml:- Go to this
pom.xmlexample and add the code between<build>and</build>. - Perform a Maven update to install all necessary plugins and ensure the JAR file is executable.
- Go to this
-
Create a JAR File:
- In IntelliJ IDEA:
- Go to File -> Project Structure -> Artifacts.
- Click the "+" icon to add a new artifact -> JAR -> From modules with dependencies.
- Enter the required details:
- Main Class: Select
Mainfrom the list. - Path: Save it in the project folder.
- Main Class: Select
- Click Apply -> OK.
- In IntelliJ IDEA:
-
Build the JAR File:
- Go to Build -> Build Artifacts to generate the JAR file.
-
Locate the JAR File:
- In the project folder, find the "out" folder.
- Locate the "*.jar" file inside this folder.
-
Transfer the JAR File to the VM:
- Open your terminal and navigate to the directory containing the JAR file using
cdcommand. - Transfer the file to your VM:
scp {fullname}.jar {username}@{IPv4}:. - Example:
cd /Users/macbook/IdeaProjects/NASAImage/out/artifacts/NASAImage_jar2 scp NASAImage.jar kgrigor2019@62.84.121.112:.
- Open your terminal and navigate to the directory containing the JAR file using
-
Verify the File on the VM:
- On the VM terminal, check for the file:
ls *.jar
- On the VM terminal, check for the file:
-
Create Application User and Group:
- Follow the instructions to create an application user and group from this guide.
-
To Run application:
- Enter
java -jar <your_jar>and go to telegram to check this. - Check the autonomous work at your local time at 12:00!
- Enter





