Jump to content

No idea how to approach this

- - - - -

  • Please log in to reply
7 replies to this topic

#1
tom13dm

tom13dm

    Newbie

  • Members
  • Pip
  • 3 posts
Let's say I'm making a simple website for sneaker enthusiasts. I would have articles about certain shoes and they would contain links to websites where you can purchase them. Now let's say I want my website to be able to check whether that site currently has the shoe in stock, or maybe even have it display which sizes are currently available from which site. Now I honestly wouldn't even know where to begin with this, I don't really know if it's possible or what language I would want to use. I was hoping somebody here could shine some light on this for me.

#2
RhetoricalRuvim

RhetoricalRuvim

    JavaScript Programmer

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,254 posts
  • Location:C:\Countries\US

maurymw said:

..................

What do you mean by ".................." ?

* * *

@tom13dm: I would imagine you would need a web type of programming language. The ones I can think of are Perl, PHP, Python, Ruby, or JavaScript/VBScript (ASP). Maybe some artificial intelligence (AI) would be useful too, but that's not a requirement as long as you are willing to either find a way to or do it yourself, in going to the different websites and seeing where it says if it's in stock, where it says the prices, etc. Haskell or Lisp (functional languages) can be used for AI, but I think AI can also be implemented in procedural or prototype languages as well, but you would need to figure out how to put it together.

#3
A3MIRAL

A3MIRAL

    Newbie

  • Members
  • PipPip
  • 14 posts
I'm not sure, but contacting the company may be the only efficient way, as it's their data and maybe they could hook you up. I'm not sure though.
They only other way I can think of it saving the page as plain text, stripping the tags, and then have some form of algorithm to parse the content. But that would use a lot of bandwidth and resources.

I'm interested in hearing other people's input.

#4
tom13dm

tom13dm

    Newbie

  • Members
  • Pip
  • 3 posts
Well see the purpose of this would be so that I wouldn't have to manually keep checking all the different websites and updating my page on my own. Ideally I would just write some code that would check the website I give it to see if it's in stock (obviously the code would have to be written specifically for the site in question). I'm not sure how exactly this would work but I guess what I'm picturing is that my site will execute this code every so often and update the pages accordingly.

#5
A3MIRAL

A3MIRAL

    Newbie

  • Members
  • PipPip
  • 14 posts
Then you would have to either run it manually every so often or create a timed event in terminal to run the PHP script as an excutable.

#6
tom13dm

tom13dm

    Newbie

  • Members
  • Pip
  • 3 posts

A3MIRAL said:

Then you would have to either run it manually every so often or create a timed event in terminal to run the PHP script as an excutable.
Yeah that sounds like it would work. So that takes care of the second part, I still need to figure out how I would write this code.

#7
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
  • Location:Vancouver, Eh! Cleverness: 200
I do not think they would like people to catalogue and possibly take customers away from their site to yours, lifting content and parsing it would be wrongful in this situation along with things like sports scores and weather.

That being said, you could probably just parse the pages of each specific sneaker and look for "in stock" with a simple string search. You could even cache the results for a week as to limit bandwidth. I'd recommend a simple yet effective database for this application (match your pages to their pages, last retrieved stock status, ...)
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#8
A3MIRAL

A3MIRAL

    Newbie

  • Members
  • PipPip
  • 14 posts
That's a good idea on how to do it! ^
I guess it's kind of how to practically execute my though of parsing the page.

And you should have it post a link. So basically:

"You're in luck, the item is in stock!"
<link to page to buy item>




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users