Best way to increase eBay thumb images?

An RSS/Atom newsreader with features comparable to commercial newsreaders.
kevin1
Harmless
Posts: 12
Joined: Mon Nov 24, 2014 1:53 pm

Best way to increase eBay thumb images?

Postby kevin1 » Tue Sep 13, 2016 12:58 pm

Hi,

I love Vienna but one nit for me has always been that the eBay image thumbnail sizes are too small to see the item detail. They seem to default to 80px. I finally got a few minutes to poke around in the code this morning and hacked something that works for me but was wondering if there was a better way to do it. Don't know if you can modify stuff like this with the plugins?

Thanks,
Kevin

Mod (see blue text):

Class: ArticleView.m

/* articleTextFromArray
* Create an HTML string comprising all articles in the specified array formatted using
* the currently selected template.
*/
-(NSString *)articleTextFromArray:(NSArray *)msgArray
{
NSUInteger index;

NSMutableString * htmlText = [[NSMutableString alloc] initWithString:@"<!DOCTYPE html><html><head><meta content=\"text/html; charset=UTF-8\">"];
// the link for the first article will be the base URL for resolving relative URLs
[htmlText appendString:@"<base href=\""];
[htmlText appendString:[SafeString(((Article *)msgArray[0]).link) stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
[htmlText appendString:@"\">"];
if (cssStylesheet != nil)
{
[htmlText appendString:@"<link rel=\"stylesheet\" type=\"text/css\" href=\""];
[htmlText appendString:cssStylesheet];
[htmlText appendString:@"\">"];
}
if (jsScript != nil)
{
[htmlText appendString:@"<script type=\"text/javascript\" src=\""];
[htmlText appendString:jsScript];
[htmlText appendString:@"\"></script>"];
}
[htmlText appendString:@"<meta http-equiv=\"Pragma\" content=\"no-cache\">"];
[htmlText appendString:@"</head><body>"];
for (index = 0; index < msgArray.count; ++index)
{
Article * theArticle = msgArray[index];

// Load the selected HTML template for the current view style and plug in the current
// article values and style sheet setting.
NSMutableString * htmlArticle;
if (htmlTemplate == nil)
{
NSMutableString * articleBody = [NSMutableString stringWithString:SafeString(theArticle.body)];
[articleBody fixupRelativeImgTags:SafeString([theArticle link])];
[articleBody fixupRelativeIframeTags:SafeString([theArticle link])];
[articleBody fixupRelativeAnchorTags:SafeString([theArticle link])];
htmlArticle = [[NSMutableString alloc] initWithString:articleBody];
}
else
{
htmlArticle = [[NSMutableString alloc] initWithString:@""];
NSScanner * scanner = [NSScanner scannerWithString:htmlTemplate];
NSString * theString = nil;
BOOL stripIfEmpty = NO;

// Handle conditional tag expansion. Sections in <!-- cond:noblank--> and <!--end-->
// are stripped out if all the tags inside are blank.
while(!scanner.atEnd)
{
if ([scanner scanUpToString:@"<!--" intoString:&theString])
[htmlArticle appendString:[theArticle expandTags:theString withConditional:stripIfEmpty]];
if ([scanner scanString:@"<!--" intoString:nil])
{
NSString * commentTag = nil;

if ([scanner scanUpToString:@"-->" intoString:&commentTag] && commentTag != nil)
{
commentTag = commentTag.trim;
if ([commentTag isEqualToString:@"cond:noblank"])
stripIfEmpty = YES;
if ([commentTag isEqualToString:@"end"])
stripIfEmpty = NO;
[scanner scanString:@"-->" intoString:nil];
}
}
}
}

// Separate each article with a horizontal divider line
if (index > 0)
[htmlText appendString:@"<hr><br />"];
[htmlText appendString:htmlArticle];
}
[htmlText appendString:@"</body></html>"];

// kfr Make ebay thumbnails bigger 9-13-2016
if ([htmlText localizedCaseInsensitiveContainsString:@"www.ebay"])
[htmlText replaceOccurrencesOfString:@"80px" withString:@"240px" options:0 range:NSMakeRange(0, htmlText.length)];


return htmlText;
}

Thanks,
Kevin

User avatar
josh64x2
Cocoaforge Admin
Posts: 153
Joined: Sat Sep 06, 2014 1:38 am
Location: Sydney, Australia
Contact:

Re: Best way to increase eBay thumb images?

Postby josh64x2 » Sun Sep 18, 2016 12:12 am

Hi Kevin,

I'm glad to hear you're enjoying Vienna :)
So eBay seems to provide only 80px images for thumbnails in their RSS feeds and it isn't a good idea for us to add per-site workarounds in the code.
I guess the first thing to do would be to contact eBay and see if they can provide larger thumbnails in their feeds. Maybe mention something about how 80px doesn't work well in this day and age of retina displays etc?

Please post back with updates!!
I help with Vienna development.

kevin1
Harmless
Posts: 12
Joined: Mon Nov 24, 2014 1:53 pm

Re: Best way to increase eBay thumb images?

Postby kevin1 » Sun Sep 18, 2016 1:47 am

I'll send in a request but I imagine that will have the same result as sending the Queen a note asking if I can come over for a spot of tea!


Return to “Vienna”

Who is online

Users browsing this forum: Yahoo [Bot]