Results 1 to 3 of 3
Thread: Problem with CraigList Checker
- 11-22-2012, 06:46 PM #1
Member
- Join Date
- May 2010
- Location
- Florida
- Posts
- 68
- Rep Power
- 0
Problem with CraigList Checker
Hi
I am trying to build an application that checks whether there has been a new post in a specific craigslist section "Computers for example"
so I am using the getLastModified() from the HttpUrlConnection Class (the code is shown below), when I test this code on other websites it works just fine, but with craigslist website it keeps telling me there is an update and when I check I find no update, so any idea about why is it behaving like that?
Thank you and Regards.Java Code:import java.net.HttpURLConnection; import java.net.URL; import java.util.Date; public class Main{ public static void main(String args[]) throws Exception { URL url = new URL("http://orlando.craigslist.org/sya/"); HttpURLConnection httpCon = (HttpURLConnection) url.openConnection(); long date = httpCon.getLastModified(); if (date == 0) System.out.println("No last-modified information."); else System.out.println("Last-Modified: " + new Date(date)); } }
Anderson.
- 11-22-2012, 07:33 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,405
- Blog Entries
- 7
- Rep Power
- 17
Re: Problem with CraigList Checker
Can't that date be somewhere in the past? (unequal to zero)
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 11-22-2012, 08:07 PM #3
Member
- Join Date
- May 2010
- Location
- Florida
- Posts
- 68
- Rep Power
- 0
Similar Threads
-
Sudoku checker
By kennemercollege in forum New To JavaReplies: 3Last Post: 04-27-2011, 12:41 PM -
number checker?
By linc186 in forum New To JavaReplies: 3Last Post: 03-05-2011, 11:12 AM -
isbn checker
By jingliu316 in forum New To JavaReplies: 2Last Post: 10-27-2010, 07:31 PM -
Grammar Checker
By zaz_rin in forum New To JavaReplies: 1Last Post: 07-19-2009, 02:01 PM -
ISBN Checker
By blobs86 in forum New To JavaReplies: 1Last Post: 03-23-2009, 11:07 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks