Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14

Thread: News Feeds

  1. #1
    Member
    Join Date
    Sep 2006
    Posts
    39
    Member #
    13897
    Hello people,
    Im working on a site for my friend and he wants the attached BBC news feed on his website! fair enough - so i have found and tested the attached htm. file but i can not get the size to change?
    Can i do this? Do i need to change the original feed?? Unfortunately i do not know much about feeds.
    If i cant change the Feed size can i control it with CSS?
    I need it to be a little smaller as its dominating his web page layout.
    Any help would be Bo-tastic!
    Thanks, Edd.

  2.  

  3. #2
    Junior Member
    Join Date
    Oct 2006
    Posts
    4
    Member #
    14159
    What do you mean when you say the size is too big? The file size or the actual size it takes up on the page?

  4. #3
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,755
    Member #
    5580
    Liked
    720 times
    If your web page has the extension .php (instead of .html), you can use
    a PHP script to utilize their RSS feed, thus doing whatever you want with
    the data. An RSS feed is just a XML file that is read-in and an existing PHP
    script can display the feed.

    Without getting into a ton of detail here, you can view some of these
    Google finds and possibly get something out of it.
    http://www.google.com/search?q=php+r...er&btnG=Search

    The key thing is to go to their site and see what URL they are providing for
    their RSS feed. By using their RSS feed URL, whenever your website is
    viewed, it will always reflect the latest RSS from their site ... thus will automatically
    keep updated. That's sort of the whole point of using RSS feeds.


  5. #4
    Member
    Join Date
    Sep 2006
    Posts
    39
    Member #
    13897
    Hi Radman / Mlseim,
    Cheers for your responses - i do mean size on page and not file size - sorry this was not clear!
    I dont know much about PHP so how easy is it to resize this? Is there somewhere that can tell me how to do it?
    Any help would be ubber cool!
    Thanks Edd.

  6. #5
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,755
    Member #
    5580
    Liked
    720 times
    edd ...

    I'm still a bit confused about this ...

    Are you reading their XML with some PHP RSS Reader, or are you
    just manually grabbing some HTML from their site? I'm not sure
    how that section you're showing us is getting onto your website.


  7. #6
    Member
    Join Date
    Sep 2006
    Posts
    39
    Member #
    13897
    mlseim,
    I grabbed the HTML directly from there website - its updating itself which is what i wanted. Hope this helps to explain!

    I think ive jumped in at the deep end with a cartoon anvil tied round my ankles! I may need to use the links you provided in your google search to understand feeds better!

    Any help on the PHP would still be helpful - I find PHP really difiicult to get into : i know i need to learn it and i want to, but i certainly do not come at it from programming background!

    I have registered with feed publish.com to try and start form scratch with this feed - still do not know if this is the right way to do it!

    Cheers,
    Edd.

  8. #7
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,755
    Member #
    5580
    Liked
    720 times
    OK,

    How is it updating itself?

    ============

    Let's do it this way ...

    Go to the website where you are getting your information.
    Give us a link to that site ... they must have an RSS button
    on there that we can see.

    Then, you will change the extension of your webpage to .php
    (assuming it's now .html)

    Then, we can help you grab the current RSS feed each time your
    page is displayed. That's the part I don't see yet ... how do you
    know that the existing HTML you have now is current?

    With a PHP feed reader (which is simple to use), you will always have
    the current RSS feed on your webpage, automatically.


    EDIT:
    I think I see it now ... they're doing it with some Javascripting method.
    I've got a PHP method that you will use (the proper way to do it),
    and you can customize it to your own CSS style. We'll need to see your
    website to see the CSS you already have and how your site looks, and where
    it should fit-in.


    .


  9. #8
    Member
    Join Date
    Sep 2006
    Posts
    39
    Member #
    13897
    Cool cheers for your help -
    I will have to post the feed on here tomorrow as im stacked out with work at the min.
    Check back tomorrow and i should hopefully have it posted for you.
    Thanks for your help mlseim.

  10. #9
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,755
    Member #
    5580
    Liked
    720 times
    edd ...

    I think I found the RSS feed you're using.

    For the use of others who are looking into this topic,
    I'm using an RSS Reader from this website: http://lastrss.oslab.net/

    Attached to this thread is a PHP RSS Reader script that
    I had to rename "lastRSS.txt" (to attach it). Download
    that script and rename it "lastRSS.php". Then upload it
    into the same directory where your web page is located.

    Then,

    Copy and paste the next part here into a text file and
    name it, "test.php". Upload this into the same directory
    as "lastRSS.php".

    PHP Code:
    <?php

    /* 
     ======================================================================
     lastRSS usage DEMO 2
     ----------------------------------------------------------------------
     This example shows, how to
         - create lastRSS object
        - set transparent cache
        - get RSS file from URL
        - access and show fields of the result
     ======================================================================
    */

    // include lastRSS
    include "./lastRSS.php";

    // Create lastRSS object
    $rss = new lastRSS;

    // Set cache dir and cache time limit (1200 seconds)
    // (don't forget to chmod cahce dir to 777 to allow writing)
    $rss->cache_dir './temp';
    $rss->cache_time 1200;

    // Try to load and parse RSS file
    if ($rs $rss->get('http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss.xml')) {
        
    // Show website logo (if presented)
        
    if ($rs[image_url] != '') {
            echo 
    "<a href=\"$rs[image_link]\"><img src=\"$rs[image_url]\" alt=\"$rs[image_title]\" vspace=\"1\" border=\"0\" /></a><br />\n";
            }
        
    // Show clickable website title
        
    echo "<big><b><a href=\"$rs[link]\">$rs[title]</a></b></big><br />\n";
        
    // Show website description
        
    echo "$rs[description]<br />\n";
        
    // Show last published articles (title, link, description)
        
    echo "<ul>\n";
        foreach(
    $rs['items'] as $item) {
            echo 
    "\t<li><a href=\"$item[link]\">".$item['title']."</a><br />".$item['description']."</li>\n";
            }
        echo 
    "</ul>\n";
        }
    else {
        echo 
    "Error: It's not possible to reach RSS file...\n";
    }
    ?>
    Go to the URL, (with test.php) and see what appears.

    It will be the feed from the BBC site, in a non-formatted
    output. Using CSS with the "test.php" script will allow the
    RSS list to appear any way you want.

    You will customize the script above with your own CSS style sheet
    and insert the portion into the <div> where your RSS feed should appear.


  11. #10
    Member
    Join Date
    Sep 2006
    Posts
    39
    Member #
    13897
    Max,

    THANK YOU! THANK YOU! THANK YOU!
    I will have a crack at this over the weekend. I hope i can get it to work - if there is anything i get stuck on i will post here again!

    Thanks for your help. As you are so helpful im about to post another PHP scripting problem that i have (regarding contact forms) on a live site. Just incase you feel like being the helpful guru that you are again!

    Cheers,
    Edd.


Page 1 of 2 1 2 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 06:16 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com