Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tvgids
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
tvgids
Commits
49ddba0d
Commit
49ddba0d
authored
Jun 07, 2014
by
Taddeus Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added IMDB URL to details page of movies / series
parent
058a4c8a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
details.php
details.php
+21
-2
No files found.
details.php
View file @
49ddba0d
...
...
@@ -57,8 +57,27 @@ assert(preg_match('%<ul\s+id="prog-info-content-colleft">\s*(.*?)\s*</ul>' .
'(?:\s*<ul\s+id="prog-info-content-colright">\s*(.*?)\s*</ul>)?%s'
,
$page
,
$m2
));
assert
(
preg_match_all
(
'%<li><strong>([\w ]+):</strong>(.*?)</li>%'
,
$m2
[
1
]
.
$m2
[
2
],
$m3
));
$properties
=
array
();
foreach
(
$m3
[
1
]
as
$i
=>
$name
)
$properties
[]
=
array
(
'name'
=>
$name
,
'value'
=>
$m3
[
2
][
$i
]);
$movie_search_url
=
'http://www.imdb.com/xml/find?json=1&nr=1&tt=on&q='
;
$title
=
null
;
foreach
(
$m3
[
1
]
as
$i
=>
$name
)
{
$value
=
$m3
[
2
][
$i
];
// Add IMDB URL for movie/series
if
(
$value
==
'Film'
||
$value
==
'Serie/Soap'
)
{
$results
=
json_decode
(
file_get_contents
(
$movie_search_url
.
urlencode
(
$title
)),
true
);
if
(
count
(
$results
)
>
0
)
{
$lst
=
reset
(
$results
);
$id
=
$lst
[
0
][
'id'
];
$value
.=
' (<a href="http://www.imdb.com/title/'
.
$id
.
'" target="_blank">IMDB</a>)'
;
}
}
elseif
(
$name
==
'Titel'
)
{
$title
=
$value
;
}
$properties
[]
=
array
(
'name'
=>
$name
,
'value'
=>
$value
);
}
header
(
'Content-Type: application/json; charset=utf-8'
);
echo
json_encode
(
compact
(
'description'
,
'properties'
),
JSON_UNESCAPED_SLASHES
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment