Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5960833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:52:50+00:00 2026-05-22T18:52:50+00:00

I got an interesting little side project inspired by today’s xkcd tooltip. Basically the

  • 0

I got an interesting little side project inspired by today’s xkcd tooltip.
Basically the premise is that for any Wikipedia article, if you follow the first link (that is not inside brackets or in italics) over and over eventually you will get to the Philosophy article.

I am trying to write a program that basically chooses a wikipedia page at random (probably using the http://en.wikipedia.org/wiki/Special:Random URL) and then determine that pages “depth” from Philosophy.

I’ve knocked up a program in C (my most familiar language) just to get the plan straight and quickly realised I knew how to do most of it apart from two “minor” (aka the important bits) problems:

char *grab_first_link(page, int n){ 
    //return url of 1st link not in italics or inside parentheses
}

void get_random_page{
    //go to http://en.wikipedia.org/wiki/Special:Random
    //wait 2 seconds
    //return the  URL generated by the random page
}

So basically I’m looking for a library that can help out with simple HTML pages. And some tips on how to get the correct link based on the aforementioned rules.

(also -I’m sure there a million+1 ways to do this more efficiently / easier, I’m just curious if I can get it all/mostly done in C)

Thanks for any help, tips, links or points in the right direction.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:52:50+00:00Added an answer on May 22, 2026 at 6:52 pm
    1. Find an HTML parser library (libxml2 might do the job) and read its manual. XPath will probably be your friend for this.
    2. Find an HTTP client library (and read its manual), then see 1.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got an interesting design question. I'm designing the security side of our project,
today I've got some interesting observation, that I need to explain. I've got my
Today I got my book Head First Design Patterns in the mail. Pretty interesting
I ran into an interesting problem at work today. I got a request to
I've got a real little interesting (at least to me) problem to solve (and,
I've got a wonderfully fun little SQL problem to solve today and thought I'd
I got an interesting error which says that headers were already sent through ob_end_flush();
I've got an interesting problem that I'd like some advice and opinions on if
We've got an interesting case where we are trying to determine how different instances
I've got an interesting SQL puzzle I haven't been able to solve, hopefully one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.