https://github.com/chisa-dev/ocr-scanner-tg-bot
simple telegram bot to extract text from images. ocr scanner bot based on ocr-space api.
https://github.com/chisa-dev/ocr-scanner-tg-bot
ocr-recognition php-telegram-bot telegram-bot text-from-image
Last synced: 26 days ago
JSON representation
simple telegram bot to extract text from images. ocr scanner bot based on ocr-space api.
- Host: GitHub
- URL: https://github.com/chisa-dev/ocr-scanner-tg-bot
- Owner: chisa-dev
- License: mit
- Created: 2022-11-03T14:49:27.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-04T15:36:40.000Z (over 2 years ago)
- Last Synced: 2025-04-06T07:56:48.510Z (29 days ago)
- Topics: ocr-recognition, php-telegram-bot, telegram-bot, text-from-image
- Language: PHP
- Homepage: https://horansoftware.t.me
- Size: 426 KB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Text from Image Scanner Telegram Bot ·
[](https://travis-ci.org/npm/npm) [](https://www.npmjs.com/package/npm) [](http://makeapullrequest.com) [](https://github.com/your/your-project/blob/master/LICENSE)
Simple Telegram Bot to extract text from image based on ocr api
## Check out The Sample Bot
## Installing / Getting started
Go to @botfather and create a new bot. Copy your api token and setwebhook by pasting this link on browser.
· Change XXXXXX with your bot token
· Change url to domain you host the php file.```shell
https://api.telegram.org/botXXXXXX/setWebHook?url=yourdomain.com/bot.php
```
### Code to editJust edit 2nd line by changing api key on bot.php
api key can be found here https://ocr.space/ocrapi
```shell
//Change OCR-KEY to your api key from ocr.space website
$result = file_get_contents('http://api.ocr.space/parse/imageurl?apikey=&url='.$id_url);
$result=json_decode($result, true);
$str='';
foreach($result['ParsedResults'] as $pareValue)
{
$str.= strval($pareValue['ParsedText']);
}
if($str!=""){
$re=
array(
'chat_id' => $chatId,
'text' => "🔍Scanned Text:\n$str\n\n@horansoftware",
'disable_web_page_preview' => false,);
send("sendMessage", $re);
} #end
```## Change Bot API Token
Don't forget pasting your bot token every where needed in the bot.php
```shell
$path = "https://api.telegram.org/bot/";
```
Code Written by
Gemechis Elias