Skip to content

Commit

Permalink
Merge pull request #132 from jikan-me/development
Browse files Browse the repository at this point in the history
Bug fixes
  • Loading branch information
irfan-dahir authored Apr 18, 2018
2 parents 0c6e6d6 + 97e0595 commit 0475029
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 16 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Changelog

### 1.15.5 stable - April 18, 18
- **[Manga]** Fix parsing bug with some serialization names - [#131](/../../issues/131) - 1.15.4
- **[Anime]** Fix parsing bug with some studio names - [#129](/../../issues/129)

### 1.15.3 stable - April 13, 18
- **[Search]**
- **[People]** Fix single item results not showing due to MAL redirecting the page - [#120](/../../issues/120)
Expand Down
2 changes: 1 addition & 1 deletion examples/test.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

$time_start = microtime(true);

$jikan->Search("supercell", PEOPLE);
$jikan->Anime(34851);

$time_end = microtime(true);
$execution_time = ($time_end - $time_start);
Expand Down
10 changes: 6 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

# Jikan - The Unofficial MyAnimelist PHP API
[![build](https://travis-ci.org/jikan-me/jikan.svg?branch=master)](https://travis-ci.org/jikan-me/jikan?branch=master) [![stable](https://img.shields.io/badge/jikanPHP-v1.15.3-blue.svg?style=flat)]() [![stable](https://img.shields.io/packagist/v/jikan-me/jikan.svg?style=flat)](https://packagist.org/packages/jikan-me/jikan) [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/jikan-me/jikan.svg)](http://isitmaintained.com/project/jikan-me/jikan "Average time to resolve an issue") [![Percentage of issues still open](http://isitmaintained.com/badge/open/jikan-me/jikan.svg)](http://isitmaintained.com/project/jikan-me/jikan "Percentage of issues still open") [![stable](https://img.shields.io/badge/PHP->=%207.0-blue.svg?style=flat)]()
[![build](https://travis-ci.org/jikan-me/jikan.svg?branch=master)](https://travis-ci.org/jikan-me/jikan?branch=master) [![stable](https://img.shields.io/badge/jikanPHP-v1.15.5-blue.svg?style=flat)]() [![stable](https://img.shields.io/packagist/v/jikan-me/jikan.svg?style=flat)](https://packagist.org/packages/jikan-me/jikan) [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/jikan-me/jikan.svg)](http://isitmaintained.com/project/jikan-me/jikan "Average time to resolve an issue") [![Percentage of issues still open](http://isitmaintained.com/badge/open/jikan-me/jikan.svg)](http://isitmaintained.com/project/jikan-me/jikan "Percentage of issues still open") [![stable](https://img.shields.io/badge/PHP->=%207.0-blue.svg?style=flat)]()



Expand All @@ -11,8 +11,10 @@ The raison d'être for Jikan is to allow developers to easily get stuff from the

### Composer
`composer require jikan-me/jikan`

PHP Documentation - [Get Started](https://jikan.moe/docs)


## [JikanREST API v2.1](https://jikan.docs.apiary.io) [![REST PHP](https://img.shields.io/badge/JikanPHP-1.7.1-blue.svg?style=flat)](https://jikan.moe)
Jikan even has it's own RESTful API service! - [Get Started](https://jikan.docs.apiary.io)

Expand Down Expand Up @@ -65,9 +67,9 @@ Jikan even has it's own RESTful API service! - [Get Started](https://jikan.docs.
- **[Python]** [JikanPy](https://github.com/AWConant/jikanpy) by Andrew Conant

## Changelog
### 1.15.3 stable - April 13, 18
- **[Search]**
- **[People]** Fix single item results not showing due to MAL redirecting the page - [#120](/../../issues/120)
### 1.15.5 stable - April 18, 18
- **[Manga]** Fix parsing bug with some serialization names - [#131](/../../issues/131) - 1.15.4
- **[Anime]** Fix parsing bug with some studio names - [#129](/../../issues/129)


[Read More](https://github.com/jikan-me/jikan/tree/master/changelog.md)
Expand Down
13 changes: 8 additions & 5 deletions src/Lib/Parser/AnimeParse.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,17 @@ public function parse() {
$this->addRule('studio', '~<span class="dark_text">Studios:</span>~', function() {
$return = [];
if (!preg_match('~None found~', $this->file[$this->lineNo + 1])) {
$array = explode(",", $this->file[$this->lineNo + 1]);
$array = explode("</a>", $this->file[$this->lineNo + 1]);

foreach ($array as $key => $value) {
preg_match('~<a href="/(.*)" title="(.*)">([\s\S]*)(</a>|)~', $value, $this->matches);
$return[] = [
'url' => BASE_URL . $this->matches[1],
'name' => strip_tags($this->matches[2])
];

if (!empty($this->matches)) {
$return[] = [
'url' => BASE_URL . $this->matches[1],
'name' => strip_tags($this->matches[2])
];
}
}
}

Expand Down
15 changes: 9 additions & 6 deletions src/Lib/Parser/MangaParse.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,16 +247,19 @@ public function parse() {
$this->addRule('serialization', '~<span class="dark_text">Serialization:</span>~', function(){
$return = [];
if (!preg_match('~None~', $this->file[$this->lineNo + 1])) {
$array = explode(",", $this->file[$this->lineNo + 1]);
$array = explode("</a>", $this->file[$this->lineNo + 1]);


foreach ($array as $key => $value) {
//preg_match('~<a href="/(.*)" title="(.*)">([\s\S]*)(</a>|)~', $value, $this->matches);
preg_match('~<a href="/(.*)" title="(.*)">(.*)</a>~', $value, $this->matches);
preg_match('~<a href="/(.*)" title="(.*)">(.*)(</a>|)~', $value, $this->matches);

$return[] = [
'url' => BASE_URL . $this->matches[1],
'name' => strip_tags($this->matches[2])
];
if (!empty($this->matches)) {
$return[] = [
'url' => BASE_URL . $this->matches[1],
'name' => strip_tags($this->matches[2])
];
}
}
}

Expand Down

0 comments on commit 0475029

Please sign in to comment.