Modify

Opened 5 years ago

Last modified 3 years ago

#6797 new defect

DailyLolMacro defunct

Reported by: bakker@… Owned by: rjollos
Priority: lowest Component: DailyLolMacro
Severity: blocker Keywords: WikiMacroBase
Cc: Trac Release: 0.11

Description (last modified by rjollos)

DailyLolMacro not working at all:

2010-03-12 15:31:17,012 Trac[loader] ERROR: Failed to load plugin from /home/trac/plugins/DailyLolMacro.py: 
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/Trac-0.11.6-py2.4.egg/trac/loader.py", line 91, in _load_py_files
    module = imp.load_source(plugin_name, plugin_file)
  File "/home/trac/plugins/DailyLolMacro.py", line 1, in ?
    class DailyLolMacro(WikiMacroBase):
NameError: name 'WikiMacroBase' is not defined

Attachments (0)

Change History (14)

comment:1 Changed 5 years ago by insaneintenti0n

huh, I'll have to look into that.

I noticed the other day it wasn't picking the right pictures, that icanhascheezburger.com changed their layout again, but if it's not working at all, that's a problem.

I see you're on trac 0.11.6. I'm only at 11.3 so that might be the difference.

comment:2 Changed 5 years ago by insaneintenti0n

Ok, I see the problem. I really should make an installer or something for this. I've just used it as a class to copy/paste into your existing macros.

It's obviously not going to work without

from trac.wiki.macros import WikiMacroBase

Who knows what else it's missing right now.

comment:3 Changed 5 years ago by roger@…

I had to add these lines to the script to make it work with newer versions of trac.

from trac.wiki.macros import WikiMacroBase
from genshi.builder import tag

comment:4 Changed 4 years ago by rjollos

  • Owner changed from insaneintenti0n to rjollos

comment:5 Changed 4 years ago by rjollos

(In [8461]) Add revision info to macro, and add missing dependencies. Refs #6797, Fixes #6574.

comment:6 Changed 4 years ago by rjollos

(In [8462]) Add revision info to macro, and add missing dependencies. Refs #6797, Fixes #6574.

comment:7 Changed 4 years ago by rjollos

Looks like we need some way to parse up that page to retrieve the image. There are a bunch of images on the page so I don't see a simple way to do this.

comment:8 Changed 4 years ago by insaneintenti0n

For a while they were using particular attributes In the HTML for the actual cat images. But I haven't seen that page in months to know what it looks like now. (iPhone apps spoil me, plus I'm responding on mine now anyway. :) ). Call it dead if you must. Maybe in the future I can take another stab at it.

comment:9 Changed 4 years ago by rjollos

If you have time to look at the page and determine how we can locate the image or video, I'm happy to update the code. In the meantime, I'll add a note to the main page noting that it's broken.

comment:10 follow-up: Changed 4 years ago by anonymous

For now, it looks like it's fixable (but I have no means for testing to try). All of the pictures have alt text that starts with "funny pictures-".

The source looks like this:

<img src='http://icanhascheezburger.files.wordpress/<image_location_and_name>' title="<title>" alt="funny pictures-<text>" />

So it shouldn't be TOO bad to parse the html for 'alt="funny pictures-' to pull out the .jpg on those lines.

comment:11 in reply to: ↑ 10 Changed 4 years ago by insaneintenti0n

I always forget to log in... that was me.

Replying to anonymous:

For now, it looks like it's fixable (but I have no means for testing to try). All of the pictures have alt text that starts with "funny pictures-".

The source looks like this:

<img src='http://icanhascheezburger.files.wordpress/<image_location_and_name>' title="<title>" alt="funny pictures-<text>" />

So it shouldn't be TOO bad to parse the html for 'alt="funny pictures-' to pull out the .jpg on those lines.

comment:12 Changed 4 years ago by rjollos

  • Description modified (diff)

comment:13 Changed 3 years ago by anonymous

Instead of trying to dissect the HTML for the home page, wouldn't it be easier to pull the data from the RSS feed?

http://feeds.feedburner.com/ICanHasCheezburger?format=xml

The feed should be in a more consistent format, plus there's less extraneous information to have to worry about.

comment:14 Changed 3 years ago by insaneintenti0n

I don't develop plugins for Trac anymore. You're more than welcome to re-write the plugin.

Add Comment

Modify Ticket

Action
as new The owner will remain rjollos.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.