2
from flexget.entry import Entry
3
from flexget import plugin, validator
6
log = logging.getLogger(__name__.rsplit('.')[-1])
9
class Generate(plugin.DebugPlugin):
10
"""Generates n number of random entries. Used for debugging purposes."""
13
return validator.factory('integer')
15
def on_feed_input(self, feed, config):
16
amount = config or 0 # make sure it's an int, and not None etc.
17
for i in range(amount):
21
entry['url'] = 'http://localhost/generate/%s/%s' % (i, ''.join([random.choice(string.letters + string.digits) for x in range(1, 30)]))
22
entry['title'] = ''.join([random.choice(string.letters + string.digits) for x in range(1, 30)])
23
entry['description'] = ''.join([random.choice(string.letters + string.digits) for x in range(1, 1000)])
24
feed.entries.append(entry)