Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icons for RSS/Atom accounts #21

Open
fuddl opened this issue Dec 16, 2014 · 5 comments
Open

Icons for RSS/Atom accounts #21

fuddl opened this issue Dec 16, 2014 · 5 comments

Comments

@fuddl
Copy link

fuddl commented Dec 16, 2014

RSS feeds currently one generic icon and there is no way to tell which is which. Maybe the user should be able to add an icon for each of them.

@nfarina
Copy link
Owner

nfarina commented Dec 16, 2014

Totally agree - I always wanted to let the user choose between some default icons or optionally use the icon associated with the web property behind the feed, or even select a custom icon from their computer.

@fuddl
Copy link
Author

fuddl commented Dec 16, 2014

maybe the application could check the website behind the feed for a favicon or an apple touch icon for the user to choose from

@gith-account
Copy link

gith-account commented Feb 5, 2017

As regards using favicons as menuIconImage, a quick and dirty hack (in Account.m) would be:

- (NSImage *)menuIconImage {
    NSImage *favicon = [[NSImage alloc] initWithContentsOfURL:[NSURL URLWithString:[@"https://www.google.com/s2/favicons?domain=" stringByAppendingString:self.friendlyDomain]]];
    if (favicon != nil) {
        [favicon setSize:NSMakeSize(16, 16)];
        return favicon;
    }
    else {
        return [NSImage imageNamed:[self.iconPrefix stringByAppendingString:@".tiff"]] ?: [NSImage imageNamed:@"Default.tiff"];
    }
}

This works but has some drawbacks:

  • It is usually recommended against using the synchronous "initWithContentsOfURL" in this way.

  • All favicons are (repeatedly) fetched from Google which is bad in terms of data privacy.

  • As far as I can see, Google always returns a 16x16px PNG image. If Google cannot find a suitable favicon, a generic icon is provided (e.g., https://www.google.com/s2/favicons?domain=google.com). Unless I am wrong about Google's response, the condition "favicon!= nil" will always be met and Feeds' own generic icons will never be used, even if a feed does not have a favicon, and the setSize command will be redundant.

The favicon could be fetched asynchronously from Google, but I do not know enough about Objective C to return the fetched icon as menuItemImage:

    NSURL *url = [[NSURL alloc] initWithString:[@"http://www.google.com/s2/favicons?domain=" stringByAppendingString:self.friendlyDomain]];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) {
    
        if (data) {
            NSImage *favicon = [[NSImage alloc] initWithData:data];
            [favicon setSize:NSMakeSize(16, 16)];
        }
    }];

Another and probably better option would be to include and use the FavIcon-Framework, written in Swift: https://github.com/bitserf/FavIcon.

Any thoughts?

p.s.: I have removed the tacky blur from Feeds' StatusItemUnread icons which improves the look a lot, in my opinion. I suggest to replace the original icons with these:

statusitemunread
statusitemunread 2x

p.p.s: When I build Feeds from source, the resulting app will always open with the preferences dialogue and fail to hide the dock icon regardless of the chosen settings. Everything else works fine and the settings (including configured RSS feeds) appear to be read, saved and shown correctly. With the ready-made build from the website I do not have this problem. Any ideas on how to fix this?

p.p.p.s: The menuIconImages flicker noticeably when you move the mouse between the list items.

p.p.p.p.s: When you hover over the topmost entry in the menu list before hovering over any other entry, its feed popup will never show. Only when you move to another item in the list, feed popups will start showing and now also appear for the first item in the list.

@gith-account
Copy link

So, is this project dead?

@nfarina
Copy link
Owner

nfarina commented Mar 27, 2017

Hi - the project is currently unmaintained. I agree with your findings - favicons would need to be cached to be practical. And the bugs you mentioned sound like problems too.

If you'd like to make a PR that addresses any of these issues, I'd be happy to review it and merge!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants