示例#1
0
 def bot_post(self, mess, args):
     'Envia un comentario a sweetter. Uso:\n\tpost <comentario>\n'
     f = mess.getFrom()
     user = f.getNode()+'@'+f.getDomain()
     try:
         suser = plugin.juser.get_filter(user)[0]
         request = Request_moc(suser.user)
         new_post(suser.user, args, request)
     except:
         return "fallo :("
示例#2
0
文件: views.py 项目: StriykeR/totem
def new(request):
    text = request.POST['text']
    uapi.new_post(request.user, text, request)
    return HttpResponseRedirect(request.META['HTTP_REFERER'])
示例#3
0
文件: posttest.py 项目: lilac/totem
#!/usr/bin/python
# -*- coding: utf-8 -*-

import random
from ublogging.models import User
from ublogging.uapi import new_post, Request_moc

posts = (
    "probando sweetter 3.0",
    "escribo un post con referencia @pepe",
    "un post con enlaces http://sweetter.net, http://danigm.net",
    "un post con varios replies @pepe, @juan, @nota",
    "un post con tíldes y ñ",
    "arrrrrrrrrrrrrrrrrrrrrrrg",
)

u = User.objects.get(username='******')
p = random.choice(posts)
new_post(u, p, Request_moc(u))
示例#4
0
#!/usr/bin/python
# -*- coding: utf-8 -*-

from ublogging.register import adduser
from ublogging.uapi import new_post, Request_moc

users = (
    ("pepe", "123", "*****@*****.**"),
    ("juan", "123", "*****@*****.**"),
    ("jose", "123", "*****@*****.**"),
    ("nota", "123", "*****@*****.**"),
    ("cabeza", "123", "*****@*****.**"),
    ("culebra", "123", "*****@*****.**"),
)

posts = (
    "probando sweetter 3.0",
    "escribo un post con referencia @pepe",
    "un post con enlaces http://sweetter.net, http://danigm.net",
    "un post con varios replies @pepe, @juan, @nota",
    "un post con tíldes y ñ",
    "arrrrrrrrrrrrrrrrrrrrrrrg",
)

for i in users:
    u = adduser(*i)
    for p in posts:
        new_post(u, p, Request_moc(u))
示例#5
0
文件: views.py 项目: lilac/totem
def update(request):
    user = request.user
    status = request.POST['status']
    post = uapi.new_post(user, status)
    return HttpResponse(json.dumps(jsonize_post(post)),
            mimetype='application/json')
示例#6
0
def new(request):
    text = request.POST['text']
    uapi.new_post(request.user, text, request)
    return HttpResponseRedirect(request.META['HTTP_REFERER'])