コード例 #1
0
ファイル: main.py プロジェクト: glennib/RussiaBot
def append_translation_link(submission):
    global _current_comment
    _current_comment += "\n\n"
    url = (
        "https://translate.google.com/translate?hl=en&sl="
        + config.source_language
        + "&tl="
        + config.target_language
        + "&u="
    )
    url += submission.url
    _current_comment += auxiliary.create_url("Read webpage with Google Translate", url)
    _current_comment += "."
コード例 #2
0
ファイル: main.py プロジェクト: glennib/RussiaBot
def append_footer(submission):
    global _current_comment
    _current_comment += (
        "\n\n---\n\n"
        "I am a bot. I provide the English title translation of posts in Russian here in /r/russia."
        "\n\n"
        "Feedback? "
    )
    _current_comment += auxiliary.create_url(
        "Message the author", "https://np.reddit.com/message/compose/?to=RussiaBot"
    )
    _current_comment += ". OP: You may "
    url = "https://np.reddit.com/message/compose/?to=RussiaBot&subject=Action:Delete:"
    url += submission.id
    url += "&message=Leave a comment or just as it is."
    _current_comment += auxiliary.create_url("delete", url)
    _current_comment += " or "
    url = "https://np.reddit.com/message/compose/?to=RussiaBot&subject=Action:Replace:"
    url += submission.id
    url += "&message=Replace this text with your translation, and I will replace it soon."
    _current_comment += auxiliary.create_url("replace", url)
    _current_comment += " if you think this is a bad translation."