User avatar
PrakashVasavada
Posts: 1
Joined: Thu Mar 22, 2018 11:45 am

How to get bitcoin news in php language

Thu Mar 22, 2018 11:49 am

Hello,

I need to get daily bitcoin news and display in my website.

So please give me api url or other for php,

Thanks.

User avatar
nandibear
Global Moderator
Global Moderator
Posts: 2612
Joined: Sat Jan 30, 2016 7:04 am

Donate BTC of your choice to 1DYss8ztWEgcM93SJtnpfYVt6fp7cwmjBk

Contact: Website Twitter Telegram

Re: How to get bitcoin news in php language

Mon Mar 26, 2018 8:07 pm

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/

for example:

Code: Select all

<?php $whatever = new DOMDocument(); $whatever->load('https://news.bitcoin.com/feed/'); $feed = array(); foreach ($whatever->getElementsByTagName('item') as $rss) {
you can write the rest and pick the items you want.
Image

User avatar
nandibear
Global Moderator
Global Moderator
Posts: 2612
Joined: Sat Jan 30, 2016 7:04 am

Donate BTC of your choice to 1DYss8ztWEgcM93SJtnpfYVt6fp7cwmjBk

Contact: Website Twitter Telegram

Re: How to get bitcoin news in php language

Tue Mar 27, 2018 9:04 am

Hello,

I need to get daily bitcoin news and display in my website.

So please give me api url or other for php,

Thanks.
Or (as opposed to example in previous comment) you could just use this:

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; } ?>
Image

Return to “Development & Technical Discussion”

Who is online

Users browsing this forum: No registered users and 23 guests