Jump to content

eyev

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

eyev's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. thanks a lot neil, right now I have figured out how to take the rss feed and spit all the titles into an SQL database Now, for the rest of the script (to filter the results of specific streams)...
  2. Hello gurus , I'm at a loss on how to parse a php feed that is dynamic.. Right now, I want to search the feed for specific node values, and return the results on wether it finds it or not... To be specific, I want to parse www.ustream.tv/live.rss and display wether select users show up on the rss feed (If their stream is online or not). I am not sure if i should be heading towards Regex or a simple DOM script, every DOM script i've tried to use struggles to search for multiple values, they want to stop once they find 1st or just don't return any results..... So my operation of method would be: -user goes to mypage.php- -mypage.php grabs live.rss- -mypage.php prints all streams currently live- -user see's which streams are live(which usernames showed up in the feed)- ustream has an API but it only supports up to 10 parallel requests, limiting functionality twofold, I had minor success working with it, but its lack to support more than 10 users per request made it not so great for my use... ANY help appreciated, even the simplest point in the right direction, if you know of something like this that's already being done, feel free to point me in that direction.. I've read a lot of RSS / Regex forum posts and have yet to find a similar/identical situation... Thanks, eyev
  3. Hi, i have an sql database with 2 users - I want to include each of their names in 1 url, however when I do: $url = 'http://www.foo.bar/'.$row[username]; it will create 2 urls with each of their names, is there a way to push them both into the same url? so if i print $url; it will put www.foo.bar/user1 and then www.foo.bar/user2 what I want it to do is put www.foo.bar/user1user2 is there anyway of doing this with mysql?
  4. here is how I am currently going at it... $users = "user1\;user2\;user3\;"; $dom = new DOMDocument(); $dom->load("http://api.ustream.tv/ust_api.xml/channel/".$users."/getInfo?key=myApiKey"); foreach ($dom->getElementsByTagname('result') as $element) { $status = $element->getAttribute('status'); foreach (($element->childNodes) as $e) { if (is_a($e, 'DOMElement')) { if ($e->tagName == 'title') { $titlez = htmlspecialchars($e->textContent); } elseif ($e->tagName == 'status') { $onornot = htmlspecialchars($e->textContent); } } } } echo($onornot); in the above example, it will grab the XML - and return with a table for user1,2,3 - the problem I am having is printing each ones results out because the usernames aren't static (they're dynamic)... so i cant just hard code user1,2,3,4,etc. because when a user would sign up, they'd not be in the code.. I want a way for it to seperate each user inside the variable(much like an array), and have the option to parse the XML for each variable in the array.. However, I've had no luck with arrays because if i try to print them all out it will spit out: Array ( [0] => Array ( [0] => user1 [1] => user2 [2] => user3 ) ) I'm just at a lost on how I can store these variables, easily call them and attach them to an XML request, and then use the variables to organize the XML document.... btw, the array code I used is: $theVariable = array("users" => array ( 0=> "neggy\;", 1=> "blindz0r\;", 2=> "vixenita\;"), ); print_r(array_values($theVariable));
  5. I will briefly explain the scenario I'm in. I'm trying to work with the Ustream.tv API, which is decent at best, but it's much better than nothing.. Right now, I am attempting to write a script that will grab an XML file, and spit out results based on what it returns. The script is generally going to display who's online and who's not out of select individuals(the ones who are on my site). You can access multiple peoples XML files parallel, so say I have 5 users who i am tracking the streams of i would just call say: user1;user2;user3;user4;user5.xml - But this is where I am running into problems, since the script will be dynamic (users could be added on a daily basis to track), I am not sure how to store the usernames. $dom->load("http://api.ustream.tv/ust_api.xml/channel/"_INSERT USERS HERE_"/getInfo?key=my api key"); My original idea was to store them in an array, however when spitting them out - they have brackets and such. If I store them in a normal variable ie: $users = "user1\;user2\;user3\;" I won't know how to distinguish them when I get the XML file back... the XML trees are setup like this: <array> <user1> <result> <username> <status> </result> </user1> <user2> <result> <username></username> <status></status> </result> </user2> etc. </array> Since the script is built to be dynamic I cant actually just hardcode user1, user2, etc. I need to find a way to make it dynamic and pick up the names from the variable then check array.user1.result.status - however, I'm at a loss on how to do this exactly.. I am sure this sounds very confusing because I am confusing myself just thinking/writing about it but I do appreciate any help offered! I'm somewhat new to PHP - i use to be pretty active but it's been a few years (the military got me away from coding but now I am back as it passes time)...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.