Download the PHP package plin-code/laravel-instagram-digest without Composer
On this page you can find all versions of the php package plin-code/laravel-instagram-digest. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download plin-code/laravel-instagram-digest
More information about plin-code/laravel-instagram-digest
Files in plin-code/laravel-instagram-digest
Package laravel-instagram-digest
Short Description Laravel package that scrapes Instagram hashtags via Apify and sends a daily Telegram digest with inline action buttons.
License MIT
Homepage https://github.com/plin-code/laravel-instagram-digest
Informations about the package laravel-instagram-digest
laravel-instagram-digest
Scrape Instagram hashtags via Apify, filter profiles by keywords and follower threshold, and send a daily Telegram digest with inline action buttons. Classify candidates with one tap.
What it does
- Runs the Apify
apify~instagram-scraperactor against a list of hashtags. - Filters results by bio/username keyword match and a minimum follower count.
- Upserts surviving profiles into
instagram_digest_profiles. - Once a day, sends the next
Npending profiles as Telegram cards with inline buttons: Interesting, Reject, Show again later. Custom actions pluggable. - Handles the callback when you tap a button: updates the profile status and removes the buttons from the message.
Bring your own data sources (hashtags, keywords, min-followers, chat id) via closures or plain config. Extend with custom action buttons and a custom card renderer.
Installation
Add to your .env:
Quickstart
In AppServiceProvider@boot:
Register the Telegram webhook:
Verify your Telegram setup end-to-end:
The demo uses a placehold.co URL for the placeholder image, so Telegram must be able to fetch that URL. If your network or bot configuration blocks external image fetches, pass a photo URL explicitly:
(Note: the --to option overrides the configured chat_id but currently uses the same placeholder image. For a full dry-run with your own image, register a custom CardRenderer — see below.)
Data sources: resolvers vs config
Every data source has two equivalent ways to supply it.
Via config (config/instagram-digest.php or env):
Via resolver closure (takes precedence when registered):
If no resolver is registered, the package falls back to config.
Custom actions
Register your own inline button:
Replace the default action set entirely:
Any class implementing PlinCode\InstagramDigest\Contracts\DigestAction is accepted.
Custom card rendering
Option A: publish the Blade view and edit it
Then edit resources/views/vendor/instagram-digest/card.blade.php.
Option B: register your own renderer
Your renderer must return a PlinCode\InstagramDigest\Support\CardPayload.
Customizing the webhook route
The webhook is registered by the package at POST /instagram-digest/webhook/{secret?} with the api middleware group. Both the URL prefix and the middleware stack are config-driven — edit config/instagram-digest.php after publishing:
Then adjust:
If you need full control (different HTTP verb, route model binding, custom controller), you can bypass the auto-registered route by setting 'middleware' => ['api', 'should-never-match'] (breaks the route) and defining your own pointing at PlinCode\InstagramDigest\Http\Controllers\WebhookController.
Scheduling
The package does NOT register any scheduled tasks. Wire the commands yourself in routes/console.php:
Events
Listen to the following events to integrate with your own domain:
| Event | Payload | Use case |
|---|---|---|
ProfileDiscovered |
Profile $profile, bool $isNew |
Sync to your CRM / lead model — $isNew distinguishes first-time discovery from refresh |
ProfileStatusChanged |
Profile $profile, string $from, string $to |
React to user classification |
DigestSent |
array $profileIds |
Metrics, auditing |
ScrapingRunCompleted |
Run $run |
Notifications |
Example listener:
Testing your integration
The package plays nicely with Laravel's HTTP fakes and event fakes. In your own tests:
For the Telegram side, fake api.telegram.org/* and assert via Http::assertSent(...).
Commands
| Command | Description |
|---|---|
instagram-digest:scrape [--sync] |
Dispatch the Apify scraping job. |
instagram-digest:send [--count=N] |
Dispatch the Telegram digest job. |
instagram-digest:webhook [url?] |
Register the Telegram webhook with Telegram. |
instagram-digest:demo [--to=id] |
Send one fake card to verify Telegram config. |
Testing
License
MIT. See LICENSE.md.
All versions of laravel-instagram-digest with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^12.0 || ^13.0
guzzlehttp/guzzle Version ^7.0