PHPackages                             mor/farsi-poem - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. mor/farsi-poem

ActiveLibrary

mor/farsi-poem
==============

V0.1.0(4y ago)03MITPHP

Since Apr 22Pushed 4y ago1 watchersCompare

[ Source](https://github.com/mohammadrezahq/FarsiPoem)[ Packagist](https://packagist.org/packages/mor/farsi-poem)[ RSS](/packages/mor-farsi-poem/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

FarsiPoem
=========

[](#farsipoem)

Get random persian poem with api.

FarsiPoem works with  api.

### Setup:

[](#setup)

Install package with composer:

```
composer require mor/farsi-poem

```

### To Use

[](#to-use)

```
use FarsiPoem\FarsiPoem;

$poem = new FarsiPoem();
```

### Get random poem

[](#get-random-poem)

```
echo $poem->random()->plainText;
```

#### Get random poem by poet

[](#get-random-poem-by-poet)

Ganjoor list of poets: حافظ (2)، خیام (3)، ابوسعید ابوالخیر (26)، صائب (22)، سعدی (7)، باباطاهر (28)، مولوی (5)، اوحدی (19)، خواجو (20)، شهریار (35)، عراقی (21)، فروغی بسطامی (32)، سلمان ساوجی (40)، محتشم کاشانی (29)، امیرخسرو دهلوی (34)، سیف فرغانی (31)، عبید زاکانی (33)، هاتف اصفهانی (25) یا رهی معیری (41)

```
$poet_id = 2; // default = 0 : random poem from random poet

$poem->random($poet_id);

echo $poem->plainText;
```

#### History mode

[](#history-mode)

This feature works with php sessions, when use save() method, the poem will save in user sessions and will show the same poem to user on page refresh and different pages.

```
$poem->save()->random();

echo $poem->plainText;
```

#### Other

[](#other)

```
$poem->save()->random();

echo $poem->plainText; // show plain text of poem.

echo $poem->verses; // show object of verses (by ganjoor api).

echo $poem->verses(Int $count = 0); // only get $count verses: 0 means all verses.

echo $poem->versesAsPlain(Int $count = 0, String $seperator = ' / '):

echo $poem->poet;
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1481d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cd6e5b25a5c4ff0268227d156516cc1bd022cb29f31f0f28ae83737e41a1dcff?d=identicon)[mohammadrezahq](/maintainers/mohammadrezahq)

---

Top Contributors

[![mohammadrezahq](https://avatars.githubusercontent.com/u/84364201?v=4)](https://github.com/mohammadrezahq "mohammadrezahq (3 commits)")

### Embed Badge

![Health badge](/badges/mor-farsi-poem/health.svg)

```
[![Health](https://phpackages.com/badges/mor-farsi-poem/health.svg)](https://phpackages.com/packages/mor-farsi-poem)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
