Access enclosures link and size in Daos/MySql/Items.php?

by mohisanisel, Friday, July 12, 2013, 16:24 (4075 days ago)

hi...
I'm trying to access the values related to enclosures of a rss feeds (podcasts) and add them into database in order to show to users. I worked alot with Selfoss and i just find ways to get thumbnails. but I need to catch other media as MP3s (for podcasts and store it to my database. I know i can do it with Daos/MySQL/Items.php but I dont know how can i find enclosures->link, enclosures->type & enclosures->size in the above file.
how can I do it?
(I have to say sorry for my bad english :-S)
ThanQ

Access enclosures link and size in Daos/MySql/Items.php?

by tobi @, Saturday, July 13, 2013, 19:01 (4074 days ago) @ mohisanisel

Hi Mohi,

selfoss uses SimplePie for fetching the RSS feed. get_enclosure is a function from SimplePie and returns a SimplePie_Enclosure object. This offers following functions:
http://simplepie.org/wiki/reference/simplepie_enclosure/start

You have to check whether the enclosure object is available. I'm not sure, but I think some podcast feed just offers a simple link. In this case you don't get any further information without downloading the mp3/video file.

I hope this helps
Regards
Tobi

Access enclosures link and size in Daos/MySql/Items.php?

by mohisanisel, Sunday, July 14, 2013, 12:45 (4074 days ago) @ tobi

Hi tobi and thank you so much for spending time on answering my question!
I understand your replay. but My problem is that i dont know how can I access value of get_link(); in Items.php...

I can not give the values just by using $link = $enclosure->get_link();. this statement gives me nothing.

~~~~~~~~~~~~~~~
daos/mysql/Items.php:
~~~~~~~~~~~~~~~

public function add($values) {

$en_link = *** enclosures link needed here. but how? ***;

\F3::get('db')->exec('INSERT INTO items (
x,
en_link,
z
) VALUES (
:x,
:en_link,
:z
)',
array(
':x' => $x,
':en_link' => $en_link,
':z' => $z
));
} }


}

RSS Feed of thread
powered by my little forum