Exemplo n.º 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 :("
Exemplo n.º 2
0
def new(request):
    text = request.POST['text']
    uapi.new_post(request.user, text, request)
    return HttpResponseRedirect(request.META['HTTP_REFERER'])
Exemplo n.º 3
0
#!/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))
Exemplo n.º 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))
Exemplo n.º 5
0
Arquivo: views.py Projeto: 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')
Exemplo n.º 6
0
def new(request):
    text = request.POST['text']
    uapi.new_post(request.user, text, request)
    return HttpResponseRedirect(request.META['HTTP_REFERER'])