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
058a4c8a
Commit
058a4c8a
authored
May 26, 2014
by
Taddeus Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated details parser for new page format
parent
74fab0e6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
details.php
details.php
+4
-3
style.sass
style.sass
+1
-1
No files found.
details.php
View file @
058a4c8a
...
...
@@ -44,7 +44,7 @@ $url = 'http://www.tvgids.nl/programma/' . $_GET['id'];
$page
=
file_get_contents
(
$url
);
// Parse detailed description, preserving a selected set of HTML tags
assert
(
preg_match
(
'
/<div\s+id="prog-content">\s*(.*?)\s*<div\s+class="prog-functionbar">/
s'
,
$page
,
$m1
));
assert
(
preg_match
(
'
%<div id="prog-content">\s*(.*?)\s*<br class="brclear"%
s'
,
$page
,
$m1
));
$description
=
strip_tags
(
$m1
[
1
],
'<p><strong><em><b><i><font><a><span><img><br>'
);
$description
=
str_replace
(
'showVideoPlaybutton()'
,
''
,
$description
);
$description
=
clean_html
(
$description
);
...
...
@@ -53,8 +53,9 @@ $description = clean_html($description);
//$description = str_replace(array('<', '>', '/'), array('<', '>', '/'), $description);
// Parse properties list
assert
(
preg_match
(
'/<ul\s+id="prog-info-content-colleft">\s*(.*?)\s*<\/ul>/s'
,
$page
,
$m2
));
assert
(
preg_match_all
(
'/<li><strong>(\w+):<\/strong>(.*?)<\/li>/'
,
$m2
[
1
],
$m3
));
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
]);
...
...
style.sass
View file @
058a4c8a
...
...
@@ -287,7 +287,7 @@ $img-ratio: 310px / 550px
strong
display
:
inline-block
width
:
7
0px
width
:
13
0px
.select-label
margin-left
:
10px
...
...
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