Hello,
I need to get daily bitcoin news and display in my website.
So please give me api url or other for php,
Thanks.
You can use the rss feed: https://news.bitcoin.com/feed/Hello,
I need to get daily bitcoin news and display in my website.
So please give me api url or other for php,
Thanks.
Code: Select all
<?php
$whatever = new DOMDocument();
$whatever->load('https://news.bitcoin.com/feed/');
$feed = array();
foreach ($whatever->getElementsByTagName('item') as $rss)
{
Or (as opposed to example in previous comment) you could just use this:Hello,
I need to get daily bitcoin news and display in my website.
So please give me api url or other for php,
Thanks.
Code: Select all
<?php
$xml= simplexml_load_file("https://news.bitcoin.com/feed/");
foreach($xml->channel->item as $item){
$title = $item->title;
$date = $item->pubDate;
$description = $item->description;
$link = $item->link;
$guid = $item->guid;
echo $title;
echo $date;
echo $description;
echo $link;
echo $guid;
} ?>
Return to “Development & Technical Discussion”
Users browsing this forum: No registered users and 23 guests