Example #1
0
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
Example #2
0
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
Example #3
0
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
Example #4
0
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