NYTimes.Articles

Search for articles since 1981 published by the New York Times. See the documentation of the API for more details.

Platforms

Silverlight

Properties

  • IsLoading Gets a value indicating whether the results are loading
  • Logo Get the Logo image for the New York Times: Logo.png
  • ResultsToGet the Gets or sets the total number of results to return
  • Fields Gets or sets the fields to return (a comma-separated list). See this for list of fields.
  • Facets Gets or sets the facets to return (separated by commas, 5 maximum)
  • Query Gets or sets the query term(s) to look for in New York Times Articles
  • ApiKey Gets or sets the New York Times Articles API Key
  • Offset Gets the result set offset
  • BeginDate Gets the begin date for the search
  • EndDate Gets the end date for the search
  • Rank Gets or sets the RankOrder (Newest | Oldest | Closest) for the results.
  • Results Gets the results of the search as a collection of NYTimes.Data.Article objects
  • Tokens Gets the result tokens as a collection of strings
  • FieldNames Gets the available field names
  • FacetNames Gets the available facet names
  • Total Get the total number of results available

Methods

  • GetArticles()

Sample

Article Demo
<UserControl x:Class="ArticlesDemo.Page"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:nyt="clr-namespace:NYTimes;assembly=NYTimesSilverlightKit"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <UserControl.Resources>
        <nyt:Articles Query="Obama" x:Key="Articles"/>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot" DataContext="{StaticResource Articles}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <TextBox Text="{Binding Query, Mode=TwoWay}"/>
        <Button Grid.Column="1" Content="Search Articles"/>
        <ListBox Grid.Row="1" ItemsSource="{Binding Results}" DisplayMemberPath="Title" 
                      Grid.ColumnSpan="2"/>
    </Grid>
</UserControl>

Last edited May 14, 2009 at 3:57 AM by mscherotter, version 13

Comments

No comments yet.