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.

Results 1 to 10 of 10

Thread: How do I...

  1. #1
    Junior Member
    Join Date
    May 2017
    Posts
    2
    Member #
    56585

    Question How do I...

    Hello all. I had a quick question I was hoping you could help me with (FYI I'm new to web designing).

    I want to create a hyperlink in my own website that links to the top news story on an external website. For example, I want a particular box (for lack of a better word) in my website to always show the top news story from the CNN website. The catch is that the stories constantly change, but I don't want to have to constantly change the external link to the newest story. So how can I create a code that does it for me automatically?

    Thanks for your help!
    Last edited by kpup275; May 12th, 2017 at 02:25 PM.

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,716
    Member #
    5580
    Liked
    718 times
    You use an api with php scripting.

    any method you use will show the headline and a brief description. You won't get the full story. Is that ok?

    see this:
    https://newsapi.org/cnn-api


  4. #3
    Junior Member
    Join Date
    May 2017
    Posts
    2
    Member #
    56585
    Thank you. Sounds like this is exactly what I need. The only problem is that it doesn't work on Wix :-/

    Any suggestions? Thanks again!

  5. #4
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,716
    Member #
    5580
    Liked
    718 times
    Nope ... Wix and Weebly are web hosts that do not allow server-side scripting, such as PHP.
    You're just out of luck. Find a different webhost?
    Sorry I don't have any solution for you.


  6. #5
    Senior Member Ronald Roe's Avatar
    Join Date
    Mar 2011
    Location
    Oklahoma City
    Posts
    3,141
    Member #
    27197
    Liked
    959 times
    Most of the time, you can use AJAX to pull in content from an API like this. Are you able to add JavaScript to Wix? If so, AJAX is pretty straightforward. Ajax Tutorial - Tutorial
    Ron Roe
    Web Developer
    "If every app were designed using the same design template, oh wait...Bootstrap."

  7. #6
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,716
    Member #
    5580
    Liked
    718 times
    JavaScript might be an idea to try. You'll get the usual harassment about people turning off javascripting and you shouldn't use it for content, etc. but it would be worth trying anyhow. IMHO, if someone turns off javascripting, too bad for them.


  8. #7
    Senior Member Ronald Roe's Avatar
    Join Date
    Mar 2011
    Location
    Oklahoma City
    Posts
    3,141
    Member #
    27197
    Liked
    959 times
    These days, ya. I've always been firmly in the "don't do that" column. I've recently changed my ways, since a) so few people do that, it's their bad, and b) front-end MVC is so common these days without a fallback or graceful degradation scheme that the world has pretty much moved on from caring about the "don't do that" paradigm.

    I've recently been picking up React. It took me a while to be OK with it, but now that I'm knee deep in it, I actually love it.
    Ron Roe
    Web Developer
    "If every app were designed using the same design template, oh wait...Bootstrap."

  9. #8
    Junior Member
    Join Date
    Jun 2017
    Location
    Edmonton
    Posts
    11
    Member #
    56755
    Liked
    2 times
    I remember a few years ago I embedded an rss feed from Google News... don't know if that's possible anymore. If you can find a public RSS feed that suits your purposes and I am sure CNN has some then look into ways to embed the feed.

    It's been a while so I don't know anymore. Also embedding other RSS feeds isn't as valuable to your users as it once was because of the way people curate information.

  10. #9
    Junior Member Sebia's Avatar
    Join Date
    Jun 2017
    Posts
    1
    Member #
    56754
    Oh I still have to get my head around react, it's been on my list for a longer period of time now.
    @Ronald: Do you have any experience with Angular, too? If so, is React your favorite framework or are there parts you would rather do with Angular?

  11. #10
    Senior Member Ronald Roe's Avatar
    Join Date
    Mar 2011
    Location
    Oklahoma City
    Posts
    3,141
    Member #
    27197
    Liked
    959 times
    I started trying to learn Angular and immediately hated it. I'm not really a framework-type person. I prefer building things out from scratch, but I decided to pick one up to keep up with the industry and remain relevant. So, I really don't have a favorite framework since I dislike the concept on its face.
    Ron Roe
    Web Developer
    "If every app were designed using the same design template, oh wait...Bootstrap."


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 10:47 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com