PDA

View Full Version : Photoblogs.org Bookmarks feed


fotogram
08-09-2005, 08:55 PM
I just uploaded an addon to consume the new bookmarks feed from the beta site for photoblogs.org. Hopefully it will be verified by PP's team and available for download soon. I am currently using it on my site at:

http://www.fotogram.com/pixelpost/index.php?x=links

blinking8s
08-09-2005, 10:47 PM
coolness! ill check it out when i have some time...love this addon!

fotogram
08-10-2005, 02:04 AM
Looks like it has been reviewed and it is now available:

http://www.pixelpost.org/v1/index.php?x=downloads&details=99

RSS is a standard, so this addon is an RSS parser. In the addon I am using to parse the Photoblogs.org (beta site) bookmarks feed, but it can be used for any RSS parsing.

blinking8s
08-10-2005, 02:05 AM
i cant wait to get time to add it to my photoblog, which is like weeks late on relaunching

massive thanks for this! and when I test it Im sure Ill thank you again, already noticed this one breaks in lists, very nice...

jus
09-20-2005, 10:20 PM
Thanks for this addon - it looks fantastic on your site.

I can't seem to find out what the URL is to my rss feed at photoblogs.org.

Am I missing something obvious here?

Thanks for any suggestions!

fotogram
09-20-2005, 11:47 PM
For this addon to work you need to use beta.photoblogs.org new bookmarks feature. The way I use it is the following:

- I bookmarked a bunch of sites that I wanted to display in my links page with the "link" tag
- My "link" tag page can be viewed at: http://beta.photoblogs.org/user/gpinto/link
- At the bottom of the page above there is an orange "RSS" icon that links to http://beta.photoblogs.org/rss/user/gpinto/link
- this is the URL I added to the addon in order to cosume that feed

Some day, when the new photoblogs.org site goes live and the URL beta.photoblogs.org no longer exists, you'll need to update the URL in the addon again to point to the non-beta URL, which will probably be the same (www.photoblogs.org).

HTH

jus
09-21-2005, 08:11 PM
Thank you.

Aha! I needed to go to beta.photoblogs.org. I was missing something basic.

However, when I put the addon in and change the username, I get this:
http://beta.photoblogs.org/user/jus 2005-09-21T16:05:39+01:00 text/html 2005-09-21T11:50:19+01:00 jus http://chromogenic.net/ text/html 2005-09-21T11:50:31+01:00 jus http://www.jorj.org/potd/ text/html 2005-09-21T11:48:39+01:00 jus http://www.markhenspeter.com/ text/html 2005-09-21T11:50:46+01:00 jus http://www.pixeladay.com/ text/html 2005-09-21T11:53:05+01:00 jus http://sannah.iamnotfromfinland.net/blog text/html 2005-09-21T11:51:05+01:00 jus http://smudo.org/blog text/html 2005-09-21T11:51:40+01:00 jus http://www.skylightweb.com/imagine/blog/ text/html 2005-09-21T11:51:18+01:00 jus http://zoomcollective.com/

appearing literally like that at the top of every page. It's putting raw XML like this:

<?xml version="1.0" encoding="ISO-8859-1"?>
<rdf:RDF
xmlns="http://purl.org/rss/1.0/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel rdf:about="">
<title>Photoblogs.org / user jus</title>
<description></description>
<link>http://beta.photoblogs.org/user/jus</link>
<dc:date>2005-09-21T16:05:39+01:00</dc:date>
<items>

at the very top of every HTML page, not just the archives page.

I guess it's something to do with the php setup on my webserver.

I'll keep following this addon, as it's a really good idea.

Best,

Justin

jus
09-24-2005, 05:36 PM
I've tried and tried with this, and it's still doing the same thing. What version of PHP is your server running? Are the XML features used in this script not available on version 4.3.11?

Also, which version of pixelpost are you running? I'm on 1.4.2 and I'm wondering if there's something in the index.php file that's making it include this xml as the first item in each page sent to the browser?

fotogram
09-26-2005, 10:41 PM
Here is my PHP info:

PHP-version 4.3.10

This addon uses cURL to read in the remote file, and it saves a version called feed.xml to the server root of your pixelpost installation (mine is /pixlepost/; i believe yours is /lux/). This xml is parsed and the list is built.

On your about_template.html you add the new tag (<PHOTOBLOGS_BOOKMARKS_FEED>) where you want the list to show.

Are you adding the new tag to the about_template.html? It sounds like you are adding the tag to the index.php; that is not correct.

jus
09-28-2005, 06:49 PM
Got it working at last.

I've no idea what I'd done wrong. uploaded the template clean and started again and it works fine. I'm getting a lot of errors on the addons page of pixelpost admin, but it's working great on the site.

Many thanks!

fotogram
09-29-2005, 04:50 PM
The errors (actually warnigs) may be conflcting addons. Remove ones you are not using anymore. I believe grablinks is one that I was having conflicts with with my own RSS feed addon.

blinking8s
10-01-2005, 10:26 AM
i get the same thing on my index as jus displayed upon uploading the addon

blinking8s
10-03-2005, 06:04 AM
yeah, grablinks conflicts with something major, my load times started dragging big time, and it almost haults the pixelpost 1.4.5 version thats in dev. I havet played with the bookmarks addon for more than a few seconds though, where i noticed the feed displaying over the index

blinking8s
10-03-2005, 09:02 AM
actually, with link+sort:alpha on the rss feed link i just get

http://beta.photoblogs.org/user/blinking8s/link+sort:alpha 2005-10-03T05:00:56+01:00

over all my pages, nothing is displayed where the tag is present

if i take links+sort:alpha out it displays the contents of the feed fine, just at the top of every page

*edit*
looks like its conflicting with paged archives addon
Warning: fopen(feed.xml): failed to open stream: Permission denied in /home/blinks/public_html/blog/addons/photoblogs_bookmarks.php on line 46

Warning: curl_setopt(): supplied argument is not a valid File-Handle resource in /home/blinks/public_html/blog/addons/photoblogs_bookmarks.php on line 48
http://beta.photoblogs.org/user/blinking8s/link+sort:alpha 2005-10-03T07:50:22+01:00
Warning: fclose(): supplied argument is not a valid stream resource in /home/blinks/public_html/blog/addons/photoblogs_bookmarks.php on line 53

Warning: fopen(feed.xml): failed to open stream: No such file or directory in /home/blinks/public_html/blog/addons/photoblogs_bookmarks.php on line 56

Warning: filesize(): Stat failed for feed.xml (errno=2 - No such file or directory) in /home/blinks/public_html/blog/addons/photoblogs_bookmarks.php on line 58

Warning: fread(): supplied argument is not a valid stream resource in /home/blinks/public_html/blog/addons/photoblogs_bookmarks.php on line 58

blinking8s
10-04-2005, 07:56 AM
php 4.3.11 here, cant get it working still

Joe[y]
10-04-2005, 04:05 PM
just so everyone is aware - there is an RSS feed for bookmarks!

http://beta.photoblogs.org/rss/user/JLSpurling/ for example.

fotogram
10-04-2005, 08:32 PM
blinking8s you do not have anything tagged with "link". This is empty:

http://beta.photoblogs.org/user/blinking8s/link

After you bookmark a few sites (with "link" or anyother tag), your RSS feed would be at:

http://beta.photoblogs.org/rss/user/blinking8s/link

Note that "link" was the tag I chose for the sites that I want to display. You could use whatever you want ("favs", "dailyvisits", "blogroll", ...), and then you swap the word "link" from the URLs above to whatever tag you chose.

HTH

blinking8s
10-04-2005, 09:05 PM
links+sorta:alpha or whichever is presenty default wasnt working for me at all, but I'll test it more later tonight.

Joe[y]
04-03-2006, 02:06 PM
photoblogs.org updated to the new site today so use this script instead: (obviously your own name and add whatever tag word you want on the end (before +sort)


<?php

//author: Guilherme Pinto (www.fotogram.com)

$addon_name = "Photoblogs.org Bookmarks Feed Parser";
$addon_description = "Parses RSS feed from Photoblogs.org and builds an unordered list with the title and the link opening in a new window. <br /><b>Make sure to change the code to point to your feed, not mine</b>.<br /> Extra tag is &lt;PHOTOBLOGS_BOOKMARKS_FEED&gt;";
$addon_version = "1.1";


$currentElements = array();
$feedArray = array();

// IMPORTANT :: change URL below for appropriate feed. YOU WANT YOUR BOOKMARKS, NOT MINE :)
readXml("http://www.photoblogs.org/rss/user/JLSpurling/+sort:alpha");

// start building the list
$list = "<ul>\n";

// loop through the array building each item
foreach($feedArray as $item)
{
$list .= "<li><a href='" . $item['link'] . "' target='_new'>" . $item['title'] . "</a></li>\n";
}

// close the list
$list .= "</ul>\n";

$tpl = str_replace("<PHOTOBLOGS_BOOKMARKS_FEED>",$list,$tpl);

/////////////////////////////////////////////
// FUNCTIONS
/////////////////////////////////////////////

// Reads XML file into formatted html
function readXML($xmlFile)
{

$xmlParser = xml_parser_create();

xml_parser_set_option($xmlParser, XML_OPTION_CASE_FOLDING, false);
xml_set_element_handler($xmlParser, startElement, endElement);
xml_set_character_data_handler($xmlParser, characterData);

// fetch file using curl and write to server
$ch = curl_init($xmlFile);
$feed = fopen("feed.xml", "w");

curl_setopt($ch, CURLOPT_FILE, $feed);
curl_setopt($ch, CURLOPT_HEADER, 0);

curl_exec($ch);
curl_close($ch);
fclose($feed);

// read fetched and saved file and parse
$fp = fopen("feed.xml", "r");

while($data = fread($fp, filesize("feed.xml")))
{
xml_parse($xmlParser, $data, feof($fp));
}

xml_parser_free($xmlParser);
}

// Sets the current XML element, and pushes itself onto the element hierarchy
function startElement($parser, $name, $attrs)
{

global $currentElements, $itemCount;

array_push($currentElements, $name);

if($name == "item"){$itemCount += 1;}

}

// Prints XML data; finds highlights and links
function characterData($parser, $data)
{

global $currentElements, $feedArray, $itemCount;

$currentCount = count($currentElements);
$parentElement = $currentElements[$currentCount-2];
$thisElement = $currentElements[$currentCount-1];

if($parentElement == "item")
{
$feedArray[$itemCount-1][$thisElement] = $data;
}
else
{
switch($name)
{
case "title":
break;
case "link":
break;
case "description":
break;
case "language":
break;
case "item":
break;
}
}

}

// If the XML element has ended, it is poped off the hierarchy
function endElement($parser, $name)
{
global $currentElements;

$currentCount = count($currentElements);
if($currentElements[$currentCount-1] == $name)
{
array_pop($currentElements);
}

}

?>

blinking8s
04-03-2006, 02:16 PM
bah i almost forgot about the update...thanks for the post joey

fotogram
04-03-2006, 09:25 PM
Thanks, Joe[y]... I'll update the addon shortly.

fotogram
04-10-2006, 04:47 AM
addon updated (1.0.1) to point to the feed location after the photoblog.org went live.

blinking8s
04-10-2006, 04:14 PM
it breaks my template...bummer

Joe[y]
04-10-2006, 06:21 PM
it breaks my template...bummer

it only produces a list (<ul>) - what breaks exactly? try not place it inside a <p>

blinking8s
04-11-2006, 05:02 AM
it places the use of the list above the page...and messes with stuff in the head. I tried to figure it out when the addon was origninally release, then I had lots of errors though

Joe[y]
04-11-2006, 09:58 AM
it places the use of the list above the page...and messes with stuff in the head. I tried to figure it out when the addon was origninally release, then I had lots of errors though

that's bad luck. if you can't figure it out show me the source and i'll have a go at it. by the way/ noticed you linked to in-public photography. met with matt stuart from there a while ago and he had a peeper at some of my photos... nice guy. http://www.in-public.com/site/mattstuart/portfolio/index.php

blinking8s
05-02-2006, 01:59 AM
yeah, still trying to get this link working...

this is what it does over every page of my photoblog
http://www.blinking8s.com/temp/picture1.png

really has me stumped...

blinking8s
05-02-2006, 10:14 PM
spent like 4 hours trying to figure it out today...no luck...grrr

Ubbe
05-04-2006, 09:47 PM
Is there anyway you can make this script work on a page that does not necessarily load through the pixelpost index site?

great idea tho :P would really like to see it work - on my page! lol

Aurora
06-01-2006, 11:41 PM
CHMOD your admin directory to 777 and all those error messages on your addons screen will go away. It's because the addon is trying to create feed.xml in your admin directory.

Is it a huge security risk to having the admin directory chmod 777 or should I put it back to 755 and deal with the junk in the addons list? Better yet would be to get the addon to stop creating the actual xml file.

Edit: and I'm now getting the same error as blinking8s. In fact, I don't even have the tag ON the page... I just have the addon installed and on and I get all that crud at the top. The XML is putting itself way at the top of the page... I'm not knowledgable enough to be able to fix it myself.

Aurora
06-06-2006, 08:17 PM
Nobody has any guidance on why blinking8s and I are having the text at the top of each page issue? :(

GeoS
06-07-2006, 08:55 AM
@Aurora: give me a link that I could see it.

There must be some error or warning in socket data exchange phase and maybe that is why we can see it. For me it works smooth :)

blinking8s
10-08-2006, 08:35 AM
on a side note, i still have this issue...finally getting around to updating some server stuff at the moment and i will update pixelpost tonight as well, we'll see if it will work then

blinking8s
10-09-2006, 12:51 PM
it must be an issue with the server, i put it in the blog this morning locally and it worked like a charm, then put it on the server and it broke the template again

http://blinking8s.com/stuff/pixelpost_feed_break.jpg

GeoS
10-09-2006, 04:53 PM
So maybe there are some headers issues that server sends all the data as output?

blinking8s
10-09-2006, 06:08 PM
i checked on my local server, php 4 and 5, worked both ways, but for some reason when i got to the web server she breaks...

i have the host looking at it now...so we'll see. really weird though

Dennis
10-09-2006, 06:35 PM
Have you tried error_reporting(all) in the index.php and examining these messages?

blinking8s
10-09-2006, 06:50 PM
results are the same, i just get the list from the feed at the top breaking the template

Connie
10-09-2006, 09:00 PM
this photoblogs-thingie seems to be really weird ;?=(

blinking8s
10-10-2006, 04:06 AM
i dont get it...

DikkieBurger
11-17-2006, 02:46 PM
Does anybody have an working version of this addon, because it puts all the links on top of my template (before <html>) and not on the place where the tag is. :confused: :confused:

Vernon.Trent
11-17-2006, 09:47 PM
it must be an issue with the server, i put it in the blog this morning locally and it worked like a charm, then put it on the server and it broke the template again

http://blinking8s.com/stuff/pixelpost_feed_break.jpg

same happens with my template too.
I've changed back to del.icio.us, which works fine.