You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nutch.apache.org by Javier Parapar Lopez <ja...@udc.es> on 2006/11/13 13:24:33 UTC

Last-modified http field

Hi, 

I am trying to implement a plugin of indexing and parsing for specific
purpose. I need to get the last-modified http field of the html
documents, to have an estimation of the publishing date of the
documents.  If I try with
parse.getData().getContentMeta().get(org.apache.nutch.metadata.HttpHeaders.LAST_MODIFIED)
it returns null because the last-modified http information is not stored
in the metadata. Does anyone know how to get it?, do I need to change
the fetcher?, any advice will be very useful.

Thanks in advance.

Javier.


Re: Last-modified http field

Posted by "Javier P. L." <li...@gmail.com>.
> Hi, 
> 
> I am trying to implement a plugin of indexing and parsing for specific
> purpose. I need to get the last-modified http field of the html
> documents, to have an estimation of the publishing date of the
> documents.  If I try with
> parse.getData().getContentMeta().get(org.apache.nutch.metadata.HttpHeaders.LAST_MODIFIED)
> it returns null because the last-modified http information is not stored
> in the metadata. Does anyone know how to get it?, do I need to change
> the fetcher?, any advice will be very useful.
> 
> Thanks in advance.
> 
> Javier.
> 

I was trying to modify the fetcher to store the lastmodified data as a
metadata field, but with the next code always returns 0 from the
getLastModified();

redirecting = false;
Protocol protocol = this.protocolFactory.getProtocol(url.toString());
ProtocolOutput output = protocol.getProtocolOutput(url, datum);
ProtocolStatus status = output.getStatus();
Content content = output.getContent();
ParseStatus pstatus = null;
switch (status.getCode()) {
case ProtocolStatus.SUCCESS: // got a page
	lastmodified =  status.getLastModified();

I am still lost. I do not know how to get the lastmodified information,
any help will be very useful. 

Thanks 
  Javier.