SearchMonkey > Start Overview > News

News - Show the publication date and a photo for news articles

Example

Description

Display news information directly in Yahoo! Search. Add code to indicate to Yahoo! that a news story on your page, and when we next crawl your site, we'll take care of the rest. From your markup, we’ll be able to extract structured data from your site and render it automatically in an enhanced result in search results.

Details

  • Types of content permitted: news articles and opinion pieces with optional images.
  • How soon after I add my markup will I see my enhanced result appear? Assuming your markup is correct, your enhanced result will appear after Yahoo! recrawls your page; this can take between a few days and a few weeks depending on your site.

Get Started

1. Add code / markup to your site

Copy this code and replace the example text with your data to see enhanced news information in Yahoo! Search.

  • Use RDFa markup to embed news metadata directly in your markup. You can provide the publication date, the headline, images, and more.
  • Use NewsML 1.2 to send your data to Yahoo! privately, using your organization's existing NewsML feed. Your NewsML document must be for an article that is published on the public web, and you must submit the feed to Yahoo!.

RDFa

Example 1

<div typeof="dcmitype:Text"
  xmlns:dcmitype="http://purl.org/dc/terms/DCMIType/"
  xmlns:dc="http://purl.org/dc/terms/"
>
  <h1>Area man walks outside apartment, picks up mail</h1>
  <div>
    <p>In a completely unexpected development, area plumber Joseph Mudge walked outside 
    his apartment and picked up his mail this morning. Local commentators are abuzz with 
    excitement.</p>
    <p>"Who could have predicted such a bold move?" said Gretchen Williams, analyst for local 
    news station KABC. "It's this kind of vitality and joie de vivre that keeps Mudge-watchers around 
    the world guessing... what will he do next?"</p>
    <p>Local blogger Jason Martin agreed that the occasion was momentous, but added a 
    note of caution. "What we don't know at this point is why Mudge chose to get his mail at this 
    particular point in time. Was it just the nice weather? Was he expecting a delivery from his 
    grandmother in Topeka? Or does he need to pay a speeding ticket from his recent trip to Los 
    Angeles? What exactly is Mudge trying to hide?"</p>
  </div>
  <p>
     Filed
     <span property="dc:issued" datatype="xsd:dateTime" content="20090923T095007+0000">Sep 9, 2009</span>
  </p>
</div>

This metadata will be available in SearchMonkey and Yahoo! Search BOSS for further use. For more information, refer to the RDFa specification or the RDFa wiki.

NOTE: To validate your markup with RDFa attributes, use this W3C DOCTYPE:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">

Example 2

<div typeof="dcmitype:Text sioc:Post"
  xmlns:dcmitype="http://purl.org/dc/terms/DCMIType/"
  xmlns:dc="http://purl.org/dc/terms/"
  xmlns:sioc="http://rdfs.org/sioc/ns#"
  xmlns:media="http://search.yahoo.com/searchmonkey/media/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
  xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
  xmlns:vcard="http://www.w3.org/2006/vcard/ns#"
>
  <h1 property="dc:title">Area man walks outside apartment, picks up mail</h1>
  <div property="dc:description">
    <p>In a completely unexpected development, area plumber Joseph Mudge walked outside 
    his apartment and picked up his mail this morning. Local commentators are abuzz with 
    excitement.</p>
    <p>"Who could have predicted such a bold move?" said Gretchen Williams, analyst for local 
    news station KABC. "It's this kind of vitality and joie de vivre that keeps Mudge-watchers around 
    the world guessing... what will he do next?"</p>
    <p>Local blogger Jason Martin agreed that the occasion was momentous, but added a 
    note of caution. "What we don't know at this point is why Mudge chose to get his mail at this 
    particular point in time. Was it just the nice weather? Was he expecting a delivery from his 
    grandmother in Topeka? Or does he need to pay a speeding ticket from his recent trip to Los 
    Angeles? What exactly is Mudge trying to hide?"</p>
  </div>
  <p>
     Filed
     <span property="dc:issued" datatype="xsd:dateTime" content="20090923T095007+0000">Sep 9, 2009</span>
     — <span property="sioc:num_replies">27</span> comments
  </p>
  <div rel="dc:publisher">
    <div typeof="vcard:Organization">
      <span property="rdfs:label vcard:organization-name">Example Press International</span>
    </div>
  </div>
  <div rel="dc:creator">
    <div typeof="vcard:VCard">
      <span property="rdfs:label vcard:fn">Lois Laney</span>
    </div>
  </div>
  <span rel="rdfs:seeAlso media:image">
    <img alt="Getting the mail" src="http://example.com/mudge.jpg"/>
  </span>
  <p property="dc:rights">2009 Example Press International</p>
</div>

This metadata will be available in SearchMonkey and Yahoo! Search BOSS for further use. For more information, refer to the RDFa specification or the RDFa wiki.

NOTE: To validate your markup with RDFa attributes, use this W3C DOCTYPE:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">

NewsML

Example 1

<?xml version="1.0" encoding="iso-8859-1"?>
<NewsML>
 <Catalog Href="http://www.example.com/dtd/catalog.xml"/>
 <NewsEnvelope>
   <DateAndTime>20090824T055004Z</DateAndTime>
 </NewsEnvelope>
 <NewsItem>
   <Identification>
     <NewsIdentifier>
       <ProviderId>example.com</ProviderId>
       <DateId>20090824</DateId>
       <NewsItemId>123456.alsdkjfas</NewsItemId>
       <RevisionId PreviousRevision="0" Update="N">1</RevisionId>
       <PublicIdentifier>urn:newsml:example.com:20090824:123456.alsdkjfas:1</PublicIdentifier>
     </NewsIdentifier>
     <NameLabel>man-walks-outside</NameLabel>
   </Identification>
   <NewsManagement>
     <NewsItemType FormalName="News"/>
     <FirstCreated>20090824T054956Z</FirstCreated>
     <ThisRevisionCreated>20090824T054956Z</ThisRevisionCreated>
     <Status FormalName="Usable"/>
     <AssociatedWith FormalName="linkbox" NewsItem="http://www.example.com/2009/08/24/man-walks-outside.html"/>
   </NewsManagement>
   <NewsComponent>
     <NewsLines>
       <HeadLine>Area man walks outside apartment, picks up mail</HeadLine>
       <DateLine>SAN FRANCISCO, United States (EPI)</DateLine>
       <CopyrightLine>2009 Example Press International</CopyrightLine>
     </NewsLines>
     <AdministrativeMetadata>
       <Provider>
         <Party FormalName="Example Press International"/>
       </Provider>
       <Creator> 
         <Party FormalName="Lois Laney"
           Vocabulary="urn:newsml:mycompany.com:20031010:people"/>
         <Contribution FormalName="Writer"/>
       </Creator>
     </AdministrativeMetadata>
     <DescriptiveMetadata>
       <Language FormalName="en"/>
     </DescriptiveMetadata>
     <NewsComponent>
       <ContentItem>
         <MediaType FormalName="Text"/>
         <Format FormalName="NITF3.2"/>
         <DataContent>
<p>In a completely unexpected development, area plumber Joseph Mudge walked outside 
his apartment and picked up his mail this morning. Local commentators are abuzz with 
excitement.</p>
<p>"Who could have predicted such a bold move?" said Gretchen Williams, analyst for local 
news station KABC. "It's this kind of vitality and joie de vivre that keeps Mudge-watchers around 
the world guessing... what will he do next?"</p>
<p>Local blogger Jason Martin agreed that the occasion was momentous, but added a 
note of caution. "What we don't know at this point is why Mudge chose to get his mail at this 
particular point in time. Was it just the nice weather? Was he expecting a delivery from his 
grandmother in Topeka? Or does he need to pay a speeding ticket from his recent trip to Los 
Angeles? What exactly is Mudge trying to hide?"</p>
<media media-type="image" style="rightSide">
<media-reference mime-type="" data-location="#photo0" />
</media>
<p>Statistics indicate that Mudge has had a history of fetching his mail at irregular 
times and frequencies...</p>
<p>...</p>
         </DataContent>
       </ContentItem>
     </NewsComponent>
     <NewsComponent Duid="photo0">
       <NewsLines>
         <HeadLine>Joseph Mudge reaches for his mail</HeadLine>
       </NewsLines> 
       <AdministrativeMetadata>
         <Provider>
           <Party FormalName="EPI"/>
         </Provider>
         <Creator>
           <Party FormalName="Jane N. Smith"/>
         </Creator>
       </AdministrativeMetadata>
       <NewsComponent>
         <Role FormalName="Caption"/>
         <ContentItem>
           <MediaType FormalName="Text"/>
           <Format FormalName="NITF3.2"/>
           <DataContent>
             <p>Plumber Joseph Mudge enjoys the morning sunshine and some sort of unidentified hot beverage as he fetches bills and personal correspondence from his mailbox.</p>
           </DataContent>
         </ContentItem>
       </NewsComponent>
       <NewsComponent>
         <Role FormalName="Thumbnail"/>
         <ContentItem Href="example-85x65.jpg">
           <MediaType FormalName="Photo"/>
           <Characteristics>
             <Property FormalName="Width" Value="85"/>
             <Property FormalName="Height" Value="65"/>
           </Characteristics>
         </ContentItem>
       </NewsComponent>
     </NewsComponent>
     <NewsComponent>
       <Role FormalName="Preview"/>
       <ContentItem Href="example-384x256.jpg">
         <MediaType FormalName="Photo"/>
         <Characteristics>
           <Property FormalName="Width" Value="384"/>
           <Property FormalName="Height" Value="256"/>
         </Characteristics>
       </ContentItem>
     </NewsComponent>
   </NewsComponent>
 </NewsItem>
</NewsML>

This markup would be included in a NewsML 1.2 feed.

IMPORTANT: Refer to the NewsML 1.2 documentation [PDF] for more information about NewsML syntax. Yahoo! Search does not support NewsML-G2.

2. Validate your markup

Test your markup to make sure your enhanced result will appear.

3. Wait until we recrawl your site for your enhanced result to appear on the search results page

This can take up to a few weeks depending on your site.

Copyright © 2009 Yahoo! Inc. All rights reserved. Copyright | Privacy Policy | Terms of Service

Help us continue to improve the Yahoo! Developer Network: Send Your Suggestions