本文整理汇总了C#中Google.GData.Client.FeedQuery类的典型用法代码示例。如果您正苦于以下问题:C# FeedQuery类的具体用法?C# FeedQuery怎么用?C# FeedQuery使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FeedQuery类属于Google.GData.Client命名空间,在下文中一共展示了FeedQuery类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: SelectUserBlog
/** Lists the user's blogs and returns the URI for posting new entries
* to the blog which the user selected.
*/
static Uri SelectUserBlog(Service service)
{
Console.WriteLine("\nPlease select a blog on which to post.");
FeedQuery query = new FeedQuery();
// Retrieving a list of blogs
query.Uri = new Uri("http://www.blogger.com/feeds/default/blogs");
AtomFeed feed = service.Query(query);
// Publishing a blog post
Uri blogPostUri = null;
if (feed != null)
{
foreach (AtomEntry entry in feed.Entries)
{
// Print out the title of the Blog
Console.WriteLine(" Blog name: " + entry.Title.Text);
Console.Write(" Post to this blog? (y/n): ");
if (Console.ReadLine().Equals("y"))
{
// find the href in the link with a rel pointing to the blog's feed
for (int i = 0; i < entry.Links.Count; i++)
{
if (entry.Links[i].Rel.Equals("http://schemas.google.com/g/2005#post"))
{
blogPostUri = new Uri(entry.Links[i].HRef.ToString());
Console.WriteLine(" Your new posts will be sent to " + blogPostUri.AbsoluteUri.ToString());
}
}
return blogPostUri;
}
}
}
return blogPostUri;
}
开发者ID:Zelxin,项目名称:RPiKeg,代码行数:37,代码来源:ConsoleSample.cs
示例2: fetch
internal CellFeed fetch(string uri)
{
try {
// フィードアドレス設定
FeedQuery singleQuery = new FeedQuery();
singleQuery.Uri = new Uri(uri);
AtomFeed feed;
SpreadsheetEntry spreadsheet;
// フィード取得
feed = service.Query(singleQuery); // 認証エラーはここから
if (feed.Entries.Count == 0) {
return null;
}
spreadsheet = (SpreadsheetEntry)feed.Entries[0];
WorksheetFeed wsFeed = spreadsheet.Worksheets;
WorksheetEntry worksheet = (WorksheetEntry)wsFeed.Entries[0];
// Fetch the cell feed of the worksheet.
CellQuery cellQuery = new CellQuery(worksheet.CellFeedLink);
cellQuery.MinimumRow = 3;
cellQuery.MinimumColumn = 2;
cellQuery.MaximumColumn = 4;
return service.Query(cellQuery);
} catch (InvalidCredentialsException) {
// 認証エラー
throw;
} catch (GDataRequestException) {
// Execution of request failed: {address}
throw;
}
}
开发者ID:jontamasan,项目名称:arma3jp-Downloader,代码行数:34,代码来源:Spreadsheet.cs
示例3: Main
static void Main(string[] args)
{
Console.WriteLine("Suchwort:");
string searchTerm = Console.ReadLine();
string uriSearchTerm = HttpUtility.UrlEncode(searchTerm);
string url = "http://gdata.youtube.com/feeds/videos?q=" + uriSearchTerm;
Console.WriteLine("Connection to YouTube - Searching: " + searchTerm);
FeedQuery query = new FeedQuery("");
Service service = new Service("youtube", "sample");
query.Uri = new Uri(url);
query.StartIndex = 0;
query.NumberToRetrieve = 20;
AtomFeed resultFeed = service.Query(query);
foreach (AtomEntry entry in resultFeed.Entries)
{
Console.WriteLine("Title: " + entry.Title.Text);
Console.WriteLine("Link: " + entry.AlternateUri.Content);
Console.WriteLine("Tags:");
foreach (AtomCategory cat in entry.Categories)
{
Console.Write(cat.Term + ", ");
}
Console.WriteLine();
}
Console.ReadLine();
}
开发者ID:davidalmas,项目名称:Samples,代码行数:31,代码来源:Program.cs
示例4: GetAllEntries
public IList<BlogEntry> GetAllEntries()
{
FeedQuery query = new FeedQuery();
query.Uri = new Uri("http://www.blogger.com/feeds/" + BlogId + "/posts/default");
query.NumberToRetrieve = 500;
return MapEntries(Service.Query(query).Entries);
}
开发者ID:Letractively,项目名称:rpcwc,代码行数:8,代码来源:BloggerDaoGData.cs
示例5: Query
/// <summary>
/// overwritten Query method
/// </summary>
/// <param name="feedQuery">The CodeSearchQuery touse</param>
/// <returns>the retrieved CodeSearchFeed</returns>
public new CodeSearchFeed Query(FeedQuery feedQuery)
{
Stream feedStream = Query(feedQuery.Uri);
CodeSearchFeed feed = new CodeSearchFeed(feedQuery.Uri, this);
feed.Parse(feedStream, AlternativeFormat.Atom);
feedStream.Close();
return feed;
}
开发者ID:nagyist,项目名称:GoogleAnalytics-MonoMac-Demo,代码行数:13,代码来源:gcodesearchservice.cs
示例6: GetGoogleCalendar
public AtomFeed GetGoogleCalendar()
{
Service service = new Service();
FeedQuery query = new FeedQuery();
query.Uri = new Uri(publicCalendarUrl);
return service.Query(query);
}
开发者ID:mukhtiarlander,项目名称:git_demo_torit,代码行数:8,代码来源:CalendarSyncGoogle.cs
示例7: UseSSLTest
public void UseSSLTest()
{
FeedQuery target = new FeedQuery(); // TODO: Initialize to an appropriate value
bool expected = true;
bool actual;
target.UseSSL = expected;
actual = target.UseSSL;
Assert.AreEqual(expected, actual);
}
开发者ID:saeedesmaeili,项目名称:google-gdata,代码行数:9,代码来源:FeedQueryTest.cs
示例8: FeedCleanup
//////////////////////////////////////////////////////////////////////
/// <summary>empty a feed</summary>
//////////////////////////////////////////////////////////////////////
protected void FeedCleanup(String uriToClean, String userName, String pwd)
{
Tracing.TraceCall();
Tracing.TraceCall("Cleaning URI: " + uriToClean);
if (!this.wipeFeeds)
{
Tracing.TraceInfo("Skipped cleaning URI due to configuration.");
return;
}
FeedQuery query = new FeedQuery();
Service service = new Service();
if (uriToClean != null)
{
if (userName != null)
{
service.Credentials = new GDataCredentials(userName, pwd);
}
GDataLoggingRequestFactory factory = (GDataLoggingRequestFactory)this.factory;
factory.MethodOverride = true;
service.RequestFactory = this.factory;
query.Uri = new Uri(uriToClean);
Tracing.TraceCall("Querying " + uriToClean);
AtomFeed feed = service.Query(query);
Tracing.TraceCall("Queryed " + uriToClean);
if (feed != null)
Tracing.TraceCall("Entries: " + feed.Entries.Count.ToString());
int iCount = 0;
if (feed.Entries.Count > 0)
{
while (feed.Entries.Count > 0)
{
Tracing.TraceCall("Feed has still " + feed.Entries.Count.ToString() + " entries left.");
foreach (AtomEntry entry in feed.Entries)
{
Tracing.TraceCall("Deleting entry " + iCount);
entry.Delete();
iCount++;
Tracing.TraceCall("Deleted entry " + iCount);
}
feed = service.Query(query);
}
Assert.AreEqual(0, feed.Entries.Count, "Feed should have no more entries, it has: " + feed.Entries.Count);
service.Credentials = null;
factory.MethodOverride = false;
}
}
}
开发者ID:mintwans,项目名称:cpsc483,代码行数:59,代码来源:baselivetestclass.cs
示例9: DefaultHostInsertOneAndDelete
/////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
/// <summary>[Test] creates a new entry, saves and loads it back</summary>
//////////////////////////////////////////////////////////////////////
[Test] public void DefaultHostInsertOneAndDelete()
{
Tracing.TraceMsg("Entering DefaultHostInsertOneAndDelete");
AtomEntry entry = ObjectModelHelper.CreateAtomEntry(1);
Service service = new Service();
FeedQuery query = new FeedQuery();
service.RequestFactory = this.factory;
int iCount=0;
string strTitle = "DefaultHostInsertOneAndDelete" + Guid.NewGuid().ToString();
entry.Title.Text = strTitle;
query.Uri = new Uri(this.defaultHost);
AtomFeed returnFeed = service.Query(query);
iCount = returnFeed.Entries.Count;
for (int i = 0; i < this.iIterations; i++)
{
Tracing.TraceMsg("DefaultHostInsertOneAndDelete, iteration : " + i);
Stream s = service.EntrySend(new Uri(this.defaultHost), entry, GDataRequestType.Insert);
s.Close();
returnFeed = service.Query(query);
Assert.AreEqual(iCount+1, returnFeed.Entries.Count, "feed should have one more entry now");
AtomEntry returnEntry = null;
foreach (AtomEntry feedEntry in returnFeed.Entries )
{
if (String.Compare(feedEntry.Title.Text, strTitle) == 0)
{
// got him
returnEntry = feedEntry;
break;
}
}
Assert.IsTrue(returnEntry != null, "did not find the just inserted entry");
returnEntry.Delete();
// query again and check count
returnFeed = service.Query(query);
Assert.AreEqual(iCount, returnFeed.Entries.Count, "feed has different number of entries as expected");
}
}
开发者ID:nagyist,项目名称:GoogleAnalytics-MonoMac-Demo,代码行数:59,代码来源:writetest.cs
示例10: ListUserBlogs
/** Lists the user's blogs. */
static void ListUserBlogs(Service service)
{
Console.WriteLine("\nRetrieving a list of blogs");
FeedQuery query = new FeedQuery();
// Retrieving a list of blogs
query.Uri = new Uri("http://www.blogger.com/feeds/default/blogs");
AtomFeed feed = null;
feed = service.Query(query);
foreach (AtomEntry entry in feed.Entries)
{
Console.WriteLine(" Blog title: " + entry.Title.Text);
}
}
开发者ID:Zelxin,项目名称:RPiKeg,代码行数:14,代码来源:ConsoleSample.cs
示例11: IndexOLD
public ActionResult IndexOLD(string id)
{
string uri;
bool permalink = false;
if (string.IsNullOrEmpty(id))
uri = _baseUri;
else
{
uri = postUri(id);
permalink = true;
}
FeedQuery query = new FeedQuery();
query.Uri = new Uri(uri);
if (!permalink)
{
query.StartIndex = 0;
query.NumberToRetrieve = 2;
}
AtomFeed feed = null;
feed = _service.Query(query);
var bpl = new List<BlogPost>();
foreach (var e in feed.Entries)
{
var bp = new BlogPost()
{
Title = e.Title.Text,
Content = e.Content.Content,
Date = e.Published,
ID = e.EditUri.Content.Substring(e.EditUri.Content.LastIndexOf('/') + 1)
};
bpl.Add(bp);
}
return View(new BlogListData()
{
//SideBarData = new Models.Shared.MainSideBarData(),
Posts = bpl
//Posts = feed.Entries.Select(e => new BlogPost()
//{
// Title = e.Title.Text,
// Content = e.Content.Content,
// Date = e.Published,
// ID = Regex.Replace(e.Links.Single(l => l.Rel == "edit").HRef.ToString(), uri + "/", "")
//}).ToList()
});
}
开发者ID:getsetcode,项目名称:getsetcode,代码行数:51,代码来源:BlogController.cs
示例12: LoadWebinars
private IList<Webinar> LoadWebinars()
{
var service = new YouTubeService("HibernatingRhinosExercise");
var query = new FeedQuery(_uri);
var webinars = new List<Webinar>();
AtomFeed result = service.Query(query);
if (result != null)
{
webinars = ParseAtomFeed(result);
}
return webinars;
}
开发者ID:seesharpdev,项目名称:HibernatingRhinos,代码行数:14,代码来源:WebinarService.cs
示例13: FindWebinars
public IList<Webinar> FindWebinars(string keyword)
{
var service = new YouTubeService("HibernatingRhinosExercise");
var query = new FeedQuery("https://gdata.youtube.com/feeds/api/videos?q={0}" + keyword);
var webinars = new List<Webinar>();
AtomFeed result = service.Query(query);
if (result != null)
{
webinars = ParseAtomFeed(result);
}
return webinars;
}
开发者ID:seesharpdev,项目名称:HibernatingRhinos,代码行数:14,代码来源:WebinarService.cs
示例14: getActivityFeed
public void getActivityFeed(String feedUri)
{
FeedQuery query = new FeedQuery();
query.Uri = new Uri(feedUri);
AtomFeed feed = service.Query(query);
foreach (AtomEntry entry in feed.Entries)
{
Console.WriteLine(String.Format("Page: {0}", entry.Title.Text));
String actionType = getCategoryLabel(entry.Categories);
Console.WriteLine(String.Format(" {0} on {1}, by {2}", actionType,
entry.Updated.ToShortDateString(), entry.Authors[0].Email));
}
}
开发者ID:machshevet,项目名称:gdata-samples,代码行数:15,代码来源:SitesAPIDemo.cs
示例15: GetFeed
public static AtomFeed GetFeed(string url = "", int start = 0, int num_results = 0)
{
FeedQuery query = new FeedQuery("");
Google.GData.Client.Service service = new Google.GData.Client.Service();
query.Uri = new Uri(url);
if (start > 0) {
query.StartIndex = start;
}
if (num_results > 0) {
query.NumberToRetrieve = num_results;
}
AtomFeed feed = service.Query(query);
return feed;
}
开发者ID:janiukjf,项目名称:curtmfg,代码行数:15,代码来源:MediaModel.cs
示例16: QueryObjectTest
//////////////////////////////////////////////////////////////////////
/// <summary>[Test] public QueryObjectTest()</summary>
//////////////////////////////////////////////////////////////////////
[Test] public void QueryObjectTest()
{
Tracing.TraceInfo("Entering QueryObject Test");
FeedQuery query = new FeedQuery();
query.Uri = new Uri(this.defaultHost);
AtomCategory aCat = new AtomCategory("Test", new AtomUri("urn:test.com"));
QueryCategory qCat = new QueryCategory(aCat);
query.Categories.Add(qCat);
aCat = new AtomCategory("TestNotAndOr", new AtomUri("urn:test.com"));
qCat = new QueryCategory(aCat);
qCat.Operator = QueryCategoryOperator.OR;
qCat.Excluded = true;
query.Categories.Add(qCat);
aCat = new AtomCategory("ANDTHISONE", new AtomUri(""));
qCat = new QueryCategory(aCat);
query.Categories.Add(qCat);
aCat = new AtomCategory("AnotherOrWithoutCategory");
qCat = new QueryCategory(aCat);
qCat.Operator = QueryCategoryOperator.OR;
qCat.Excluded = true;
query.Categories.Add(qCat);
query.Query = "Hospital";
query.NumberToRetrieve = 20;
Tracing.TraceInfo("query: " + query.Uri);
Uri uri = query.Uri;
Tracing.TraceInfo("Uri: query= " + uri.Query);
query.Uri = uri;
Tracing.TraceInfo("Parsed Query URI: " + query.Uri);
Assert.IsTrue(uri.AbsolutePath.Equals(query.Uri.AbsolutePath), "both query URIs should be identical, uri: " + uri.AbsolutePath + " compared to query: " + query.Uri.AbsolutePath);
query.CategoryQueriesAsParameter = true;
uri = query.Uri;
Tracing.TraceInfo("Uri: query= " + uri.Query);
query.Uri = uri;
Tracing.TraceInfo("Parsed Query URI: " + query.Uri.AbsoluteUri);
Assert.IsTrue(uri.AbsolutePath.Equals(query.Uri.AbsolutePath), "both query URIs should be identical, uri: " + uri.AbsolutePath + " compared to query: " + query.Uri.AbsolutePath);
}
开发者ID:nagyist,项目名称:GoogleAnalytics-MonoMac-Demo,代码行数:51,代码来源:coretest.cs
示例17: PrintUserCalendars
/// <summary>
/// Prints a list of the user's calendars.
/// </summary>
/// <param name="service">The authenticated CalendarService object.</param>
static void PrintUserCalendars(CalendarService service)
{
FeedQuery query = new FeedQuery();
query.Uri = new Uri("http://www.google.com/calendar/feeds/default");
// Tell the service to query:
AtomFeed calFeed = service.Query(query);
Console.WriteLine("Your calendars:");
Console.WriteLine();
for (int i = 0; i < calFeed.Entries.Count; i++)
{
Console.WriteLine(calFeed.Entries[i].Title.Text);
}
Console.WriteLine();
}
开发者ID:mintwans,项目名称:cpsc483,代码行数:20,代码来源:CalendarDemo.cs
示例18: DefaultHostDeleteAll
//////////////////////////////////////////////////////////////////////
/// <summary>deletes all entries in defhost feed</summary>
//////////////////////////////////////////////////////////////////////
[Test] public void DefaultHostDeleteAll()
{
Tracing.TraceMsg("Entering DefaultHostDeleteAll");
FeedQuery query = new FeedQuery();
Service service = new Service();
service.RequestFactory = this.factory;
query.Uri = new Uri(this.defaultHost);
AtomFeed returnFeed = service.Query(query);
foreach (AtomEntry entry in returnFeed.Entries )
{
entry.Delete();
}
}
开发者ID:nagyist,项目名称:GoogleAnalytics-MonoMac-Demo,代码行数:19,代码来源:writetest.cs
示例19: GoogleFinanceLib
public GoogleFinanceLib()
{
Service sFinance = new Service("finance", "StockTicker");//"CCSC-StockTicker-1a");
/*
* Setup credentials.
*/
sFinance.Credentials = new GDataCredentials(sUsername, sPassword);
GDataGAuthRequestFactory rfFactory = (GDataGAuthRequestFactory)sFinance.RequestFactory;
rfFactory.AccountType = "GOOGLE";
FeedQuery fqQuery = new FeedQuery();
/*
* Need "query" uri.
*/
fqQuery.Uri = new Uri("http://www.google.com/finance");
fqQuery.Query = "GOOG";
/* AtomFeed afFeed = sFinance.Query(fqQuery);
*/
// string s = "";
}
开发者ID:PaulCurtis,项目名称:Stocks,代码行数:21,代码来源:GoogleFinanceLib.cs
示例20: GetUserCalendars
public List<Calendar> GetUserCalendars()
{
FeedQuery query = new FeedQuery();
query.Uri = new Uri(GoogleFeedsUriDefault);
// Tell the service to query:
AtomFeed calFeed = calendarService.Query(query);
List<Calendar> result = new List<Calendar>();
foreach (var item in calFeed.Entries)
{
var calID = item.SelfUri.ToString().Split(new char[] {'/'});
var calendar = new Calendar
{
Title = item.Title.Text,
CalendarID = calID.Last()
};
result.Add(calendar);
}
return result;
}
开发者ID:cizfilip,项目名称:webcsm,代码行数:22,代码来源:GoogleCalendar.cs
注:本文中的Google.GData.Client.FeedQuery类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论