def tweet(oneliner, baseurl, force=False, test=False): if not oneliner.was_tweeted or force: from oneliners.tweet import tweet as send_tweet message = format_tweet(oneliner, baseurl) result = send_tweet(message, test=test) if result: oneliner.was_tweeted = True oneliner.save() return result
def tweet(oneliner, long_url, force=False, test=False): if not oneliner.was_tweeted or force: from oneliners.url_shortener import shorten url = shorten(long_url) or long_url from oneliners.tweet import format_message message = format_message(oneliner.summary, oneliner.line, url) from oneliners.tweet import send_tweet result = send_tweet(message, test=test) if result: oneliner.was_tweeted = True oneliner.save() return result
def tweet(oneliner, force=False, test=False): if not oneliner.was_tweeted or force: long_url = 'http://bashoneliners.com/main/oneliner/%d' % oneliner.pk from oneliners.shorturl import get_goo_gl url = get_goo_gl(long_url) or long_url message = '%s %s' % ( url, oneliner.line, ) from oneliners.tweet import tweet as send_tweet result = send_tweet(message, test=test) if result: oneliner.was_tweeted = True oneliner.save() return result