def post_notice(request):
    current_site = Site.objects.get_current()
    oauth_req = OAuthRequest.from_request(request.method, request.build_absolute_uri(), headers=request.META, parameters=request.POST.copy())
    if not oauth_req:
        return HttpResponse("Not a OAuthRequest", mimetype="text/plain")
    else:
        oauth_server = OAuthServer(data_store=DataStore(oauth_req), signature_methods=signature_methods)
        oauth_server.verify_request(oauth_req)
        # TOOD Refactor this into something like omb.post_notice
        version = oauth_req.get_parameter('omb_version')
        if version != OMB_VERSION_01:
            return HttpResponse("Unsupported OMB version", mimetype="text/plain")
        listenee = oauth_req.get_parameter('omb_listenee')
        try:
            remote_profile = RemoteProfile.objects.get(uri=listenee)
        except __HOLE__:
            return HttpResponse("Profile unknown", mimetype="text/plain")
        content = oauth_req.get_parameter('omb_notice_content')
        if not content or len(content) > 140:
            return HttpResponse("Invalid notice content", mimetype="text/plain")
        notice_uri = oauth_req.get_parameter('omb_notice')
        notice_url = oauth_req.get_parameter("omb_notice_url")

        notice_app_label, notice_model_name = settings.OMB_NOTICE_MODULE.split('.')
        noticeModel = models.get_model(notice_app_label, notice_model_name)
        notice = noticeModel()
        notice.sender = remote_profile
        notice.text = content
        notice.save()
            
        return HttpResponse("omb_version=%s" % OMB_VERSION_01, mimetype="text/plain")
dataset/ETHPy150Open skabber/django-omb/omb/views.py/post_notice