// GetFeedByURL 指定のURLを持つフィードを取得
499801
func (api *NewsFeedAPI) GetFeedByURL(url string) (*sacloud.NewsFeed, error) {
	res, err := api.GetFeed()
	if err != nil {
		return nil, err
	}
	for _, r := range res {
		if r.URL == url {
			return &r, nil
		}
	}
	return nil, nil
}
608730
func (r *RepositoryCommit) GetCommentsURL() string {
	if r == nil || r.CommentsURL == nil {
		return ""
	}
	return *r.CommentsURL
}
487964
func (r *Repository) GetHTMLURL() string {
	if r == nil || r.HTMLURL == nil {
		return ""
	}
	return *r.HTMLURL
}
254084
func (m *MarketplacePlanAccount) GetURL() string {
	if m == nil || m.URL == nil {
		return ""
	}
	return *m.URL
}
697962
func (api *NewsFeedAPI) GetFeed() ([]sacloud.NewsFeed, error) {

	var res = []sacloud.NewsFeed{}
	data, err := api.client.newRequest("GET", NewsFeedURL, nil)
	if err != nil {
		return res, err
	}

	if err := json.Unmarshal(data, &res); err != nil {
		return nil, err
	}
	return res, nil
}
166200
func (p *PullRequestReview) GetHTMLURL() string {
	if p == nil || p.HTMLURL == nil {
		return ""
	}
	return *p.HTMLURL
}
1330140
func (r *RepositoryComment) GetURL() string {
	if r == nil || r.URL == nil {
		return ""
	}
	return *r.URL
}
697593
func (c *Contributor) GetFollowingURL() string {
	if c == nil || c.FollowingURL == nil {
		return ""
	}
	return *c.FollowingURL
}
684539
func (d *DiscussionComment) GetHTMLURL() string {
	if d == nil || d.HTMLURL == nil {
		return ""
	}
	return *d.HTMLURL
}
711354
func (r *RepositoryInvitation) GetURL() string {
	if r == nil || r.URL == nil {
		return ""
	}
	return *r.URL
}
564971
func (r *RDBDriver) GetFetchedFeedMeta(url string) (*models.FeedMeta, error) {
	meta := models.FeedMeta{}
	m := &models.FeedMeta{
		URL: url,
	}
	err := r.conn.Where(m).First(&meta).Error
	if err != nil && err != gorm.ErrRecordNotFound {
		return nil, err
	}
	return &meta, nil
}
16051
func (p *PullRequest) GetHTMLURL() string {
	if p == nil || p.HTMLURL == nil {
		return ""
	}
	return *p.HTMLURL
}
1114120
func (f *Parser) ParseURL(feedURL string) (feed *Feed, err error) {
	client := f.httpClient()

	req, err := http.NewRequest("GET", feedURL, nil)
	if err != nil {
		return nil, err
	}
	req.Header.Set("User-Agent", "Gofeed/1.0")
	resp, err := client.Do(req)

	if err != nil {
		return nil, err
	}

	if resp != nil {
		defer func() {
			ce := resp.Body.Close()
			if ce != nil {
				err = ce
			}
		}()
	}

	if resp.StatusCode < 200 || resp.StatusCode >= 300 {
		return nil, HTTPError{
			StatusCode: resp.StatusCode,
			Status:     resp.Status,
		}
	}

	return f.Parse(resp.Body)
}
940289
func retrieveFeeds(c *context.Context, ctxUser *models.User, userID int64, isProfile bool) {
	actions, err := models.GetFeeds(ctxUser, userID, c.QueryInt64("after_id"), isProfile)
	if err != nil {
		c.Handle(500, "GetFeeds", err)
		return
	}

	// Check access of private repositories.
	feeds := make([]*models.Action, 0, len(actions))
	unameAvatars := make(map[string]string)
	for _, act := range actions {
		// Cache results to reduce queries.
		_, ok := unameAvatars[act.ActUserName]
		if !ok {
			u, err := models.GetUserByName(act.ActUserName)
			if err != nil {
				if errors.IsUserNotExist(err) {
					continue
				}
				c.Handle(500, "GetUserByName", err)
				return
			}
			unameAvatars[act.ActUserName] = u.RelAvatarLink()
		}

		act.ActAvatar = unameAvatars[act.ActUserName]
		feeds = append(feeds, act)
	}
	c.Data["Feeds"] = feeds
	if len(feeds) > 0 {
		afterID := feeds[len(feeds)-1].ID
		c.Data["AfterID"] = afterID
		c.Header().Set("X-AJAX-URL", fmt.Sprintf("%s?after_id=%d", c.Data["Link"], afterID))
	}
}
474160
func (u *User) GetHTMLURL() string {
	if u == nil || u.HTMLURL == nil {
		return ""
	}
	return *u.HTMLURL
}
1262799
func (p *PullRequest) GetURL() string {
	if p == nil || p.URL == nil {
		return ""
	}
	return *p.URL
}
1205814
func (c *CodeResult) GetHTMLURL() string {
	if c == nil || c.HTMLURL == nil {
		return ""
	}
	return *c.HTMLURL
}