当前位置: 首页>>代码示例>>Java>>正文


Java SyndFeed.getTitle方法代码示例

本文整理汇总了Java中com.rometools.rome.feed.synd.SyndFeed.getTitle方法的典型用法代码示例。如果您正苦于以下问题:Java SyndFeed.getTitle方法的具体用法?Java SyndFeed.getTitle怎么用?Java SyndFeed.getTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.rometools.rome.feed.synd.SyndFeed的用法示例。


在下文中一共展示了SyndFeed.getTitle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: RSSSubscription

import com.rometools.rome.feed.synd.SyndFeed; //导入方法依赖的package包/类
public RSSSubscription(URL url, String id, ArrayList<String> subscriber, long lastDate, long lastCheck) {
    SyndFeed feed = RSSUtil.getElements(url);

    if (feed != null) {
        feedURL = url;
        ID = id;

        title = feed.getTitle();
        //Assume the first element is the newest and get the date
        this.lastDate = lastDate == -1 ? feed.getEntries().get(0).getPublishedDate().getTime() : lastDate;
        this.lastCheck = lastCheck == -1 ? System.currentTimeMillis() : lastCheck;

        subscribers = subscriber;

        System.out.println("Successfully added RSS: " + url.toString());
    } else {
        System.out.println("Unable to add RSS: " + url.toString());
    }
}
 
开发者ID:Balonbal,项目名称:slybot,代码行数:20,代码来源:RSSSubscription.java

示例2: createFeed

import com.rometools.rome.feed.synd.SyndFeed; //导入方法依赖的package包/类
@Override
public Feed createFeed(String url, SyndFeed syndFeed) {
	String title = syndFeed.getTitle();
	if (title == null) title = "RSS";
	title = StringUtils.truncateUtf8(title, MAX_AUTHOR_NAME_LENGTH);

	KeyPair keyPair = cryptoComponent.generateSignatureKeyPair();
	LocalAuthor localAuthor = authorFactory
			.createLocalAuthor(title,
					keyPair.getPublic().getEncoded(),
					keyPair.getPrivate().getEncoded());
	Blog blog = blogFactory.createFeedBlog(localAuthor);
	long added = clock.currentTimeMillis();

	return new Feed(url, blog, localAuthor, added);
}
 
开发者ID:rafjordao,项目名称:Nird2,代码行数:17,代码来源:FeedFactoryImpl.java

示例3: fetchSyndFeed

import com.rometools.rome.feed.synd.SyndFeed; //导入方法依赖的package包/类
private SyndFeed fetchSyndFeed(String url)
		throws FeedException, IOException {
	// fetch feed
	SyndFeed f = getSyndFeed(getFeedInputStream(url));

	if (f.getEntries().size() == 0)
		throw new FeedException("Feed has no entries");

	// clean title
	String title =
			StringUtils.isNullOrEmpty(f.getTitle()) ? null : f.getTitle();
	if (title != null) title = clean(title, STRIP_ALL);
	f.setTitle(title);

	// clean description
	String description =
			StringUtils.isNullOrEmpty(f.getDescription()) ? null :
					f.getDescription();
	if (description != null) description = clean(description, STRIP_ALL);
	f.setDescription(description);

	// clean author
	String author =
			StringUtils.isNullOrEmpty(f.getAuthor()) ? null : f.getAuthor();
	if (author != null) author = clean(author, STRIP_ALL);
	f.setAuthor(author);

	return f;
}
 
开发者ID:rafjordao,项目名称:Nird2,代码行数:30,代码来源:FeedManagerImpl.java

示例4: getExtLibFeed

import com.rometools.rome.feed.synd.SyndFeed; //导入方法依赖的package包/类
private ExtLibFeed getExtLibFeed(String uri) throws LibException {
    SyndFeed feed = getFeed(uri);
    List<OPDSEntryI> entries = feed.getEntries().stream().map(ExtLibOPDSEntry::new).
            collect(Collectors.toList());

    ArrayList<OPDSLink> links = new ArrayList<>();
    Optional<SyndLink> nextPage = feed.getLinks().stream().
            filter(syndLink -> REL_NEXT.equals(syndLink.getRel())).findFirst();
    nextPage.ifPresent(syndLink -> links.add(ExtLibOPDSEntry.mapLink(syndLink)));
    return new ExtLibFeed(feed.getTitle(), entries, links);
}
 
开发者ID:patexoid,项目名称:ZombieLib2,代码行数:12,代码来源:ExtLib.java


注:本文中的com.rometools.rome.feed.synd.SyndFeed.getTitle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。