mirror of
https://github.com/moparisthebest/wallabag
synced 2025-02-24 15:31:53 -05:00
[add] user_agent in file_get_contents
This commit is contained in:
parent
f41d00ed8a
commit
e1cf0fda27
@ -333,7 +333,9 @@ class Poche
|
|||||||
switch ($action)
|
switch ($action)
|
||||||
{
|
{
|
||||||
case 'add':
|
case 'add':
|
||||||
$json = file_get_contents(Tools::getPocheUrl() . '/inc/3rdparty/makefulltextfeed.php?url='.urlencode($url->getUrl()).'&max=5&links=preserve&exc=&format=json&submit=Create+Feed');
|
$options = array('http' => array('user_agent' => 'poche'));
|
||||||
|
$context = stream_context_create($options);
|
||||||
|
$json = file_get_contents(Tools::getPocheUrl() . '/inc/3rdparty/makefulltextfeed.php?url='.urlencode($url->getUrl()).'&max=5&links=preserve&exc=&format=json&submit=Create+Feed', false, $context);
|
||||||
$content = json_decode($json, true);
|
$content = json_decode($json, true);
|
||||||
$title = $content['rss']['channel']['item']['title'];
|
$title = $content['rss']['channel']['item']['title'];
|
||||||
$body = $content['rss']['channel']['item']['description'];
|
$body = $content['rss']['channel']['item']['description'];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user