git.cweiske.de
/
phorkie.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update 0.5.0 changelog
[phorkie.git]
/
src
/
phorkie
/
HtmlParser.php
diff --git
a/src/phorkie/HtmlParser.php
b/src/phorkie/HtmlParser.php
index d613452c3050231d310d2b6360d79c26ecb34175..38d8af858206627cc15b78e2c680b2ef3a72b225 100644
(file)
--- a/
src/phorkie/HtmlParser.php
+++ b/
src/phorkie/HtmlParser.php
@@
-44,7
+44,8
@@
class HtmlParser
if ($scheme == 'https' && isset($arUrl['host'])
&& $arUrl['host'] == 'gist.github.com'
) {
if ($scheme == 'https' && isset($arUrl['host'])
&& $arUrl['host'] == 'gist.github.com'
) {
- //https://gist.github.com/maddy2101/5764473
+ //https://gist.github.com/cweiske/2400389
+ // clone URL: https://gist.github.com/2400389.git
$parts = explode('/', ltrim($arUrl['path'], '/'));
if (count($parts == 2)) {
//we only want the number, not the user name
$parts = explode('/', ltrim($arUrl['path'], '/'));
if (count($parts == 2)) {
//we only want the number, not the user name
@@
-54,10
+55,10
@@
class HtmlParser
}
$title = $this->getHtmlTitle($url);
if ($title === null) {
}
$title = $this->getHtmlTitle($url);
if ($title === null) {
- $this->arGitUrls[][] = '
git
://gist.github.com/'
+ $this->arGitUrls[][] = '
https
://gist.github.com/'
. $path . '.git';
} else {
. $path . '.git';
} else {
- $this->arGitUrls[$title][] = '
git
://gist.github.com/'
+ $this->arGitUrls[$title][] = '
https
://gist.github.com/'
. $path . '.git';
}
return true;
. $path . '.git';
}
return true;
@@
-96,6
+97,7
@@
class HtmlParser
} else {
$sx = simplexml_import_dom(\DOMDocument::loadHTML($html));
}
} else {
$sx = simplexml_import_dom(\DOMDocument::loadHTML($html));
}
+ //FIXME: handle network error
$elems = $sx->xpath('//*[@rel="vcs-git"]');
$titles = $sx->xpath('/html/head/title');
$elems = $sx->xpath('//*[@rel="vcs-git"]');
$titles = $sx->xpath('/html/head/title');