Successor to cloud computing, aka tweelter new architecture

When you have to perform a real big amount of operations you have two options Increase your computational power (like using a cloud solution or scale on more servers) Move your computations to the most available cloud platform of the world: your users To improve tweelter performances and avoid overloading twitter API we are studying a new computational architecture for tweelter which can return results to the user faster and give less overhead to our servers. The key to achieve the result is to move most of the search overhead to the computers of the other users currently viewing tweelter, like SETI@home does, by using tweelter you would speed up other users searches and also your own searches.

Tweelter, the twitter filter

While speaking with the top-ix people during a meeting we started to talk about the need of a way to filter out “noise” from twitter searches. Probably everyone found that searching something on twitter returns a big list of retweets and duplicated tweets. As those reduce the ability to follow a discussion or an event on twitter they are usually more a problem than a useful result. At the end of that meeting Tweelter was born. Tweelter is a twitter search engine which filters out duplicated entries, retweets and permits to search results older than one month on most followed topics. More interesting thing is that tweelter performs those search in a parallel manner and on a distributed mongodb. While […]

Rehearsing new ACR look and feel

As some turbogears projects are starting to use ACR as their CMS library we received the first few requests by real users and the most prominent one is to have a better administrative section. Currently administration section is implemented by using the great tgext.admin and sprox, even if those are really good to quickly implement a CRUD section they might not couple very well when a more interactive and advanced user experience is required. So a transition phase that will end with a totally new administration section for ACR has been started, currently the system implements a new user interface still using the same backend as before to handle the operations, but on the long time the backend itself will […]

Injecting static content in TurboGears

Something that you usually need to do when providing a library or a reusable wsgi application is installing static data with the library itself. This can be quickly performed by adding something like package_data = {”:[‘*.html’, ‘*.js’, ‘*.css’, ‘*.png’]} to your setup.py But then how can we let our turbogears application serve that? For html files (genshi templates) the solution is quite simple, you can just expose them by using @expose(‘librarypackage.templatesdir.template’). For example supposing we are installing libcool with its templates in libcool/templates you can do @expose(‘libcool.templates.index’) For js and css files you can add them to your pages by creating a tw.api.JSLink or tw.api.CSSLink object. Just create inside your library something like: cool_js =¬†tw.api.JSLink(modname = __name__, filename = ‘static/cool.js’) […]

Using SwfUpload with TurboGears 2

SwfUpload doesn’t permit to upload things through authenticated methods, this is because it doesn’t pass the cookies needed to identify your users. Partly this problem can be solved by using swfupload.cookies.js plugin. This plugins fetches all your cookies and passes them as POST arguments. This way you can get your authtkt cookie and use it to identify your user. from webob.exc import * from paste.auth import auth_tkt if kw.has_key(‘authtkt’): #by default it is usually configured to do not use the remote address #otherwise you can fetch it from request.environ[‘REMOTE_ADDR’] remote_addr = ‘0.0.0.0’ #cookie secret is usually defined in your config/app_cfg.py #as base_config.sa_auth.cookie_secret or in your development.ini cookie_secret = “some_random_string_like_BQQP+BeyrTzTHClBCEdW” try: data = auth_tkt.parse_ticket(cookie_secret, kw.get(‘authtkt’), remote_addr) username = data[1] user = […]

ACR divided in ACRcms and libACR

As new projects started to use ACR to implement the content management part of the site we started to divide the ACR application from the content management framework to permit to other people to embed the cmf inside their own applications. Now has been divided in libACR which is the content management framework and ACRcms which is the cms application. This should make easier to use libACR to implement your own CMS or extend your web applications and also fast for anyone who needs a quickly available CMS solution to just use ACRcms and tune the graphic theme and layout.

Caching in TurboGears 2

TurboGears 2 has a quite good and complete caching support inherited from Pylons, as it is a pylons feature it is not really available by itself, but you can import it. All you need is those three little things: from pylons.decorators.cache import beaker_cache from pylons.controllers.util import etag_cache from pylons import cache The first imports a decorator which makes possible to cache entire controller methods, the second imports a function to use client side caching and the third makes available a caching repository where to store whatever data you might want. The easiest caching mechanism is etag_cache, this tells to the browser to use its own cached version of the page if it has any available instead of requesting it again […]

Personalize your Error pages in Turbogears 2

I was looking for a way to propagate exceptions from my tg2 app to the ErrorController to permit to propagate errors from controllers to the user. To generate errors and show them you usually have to redirect to /error/document and pass as parameters the error message and error code, but this isn’t really flexible and also modern languages have a really good feature to propagate errors: Exceptions. So I was looking for a way to raise a webob.exc.HTTPForbidden, place a message inside it and let the ErrorController render the message. Usually you don’t want to tell to the user what went wrong with your 500 server side exception, but you might want to tell to the user why he can’t […]

ACR Slice Preview support, remote disk, Comment and File views.

Latest version of ACR, our opensource cms for turbogears, got some new interesting features: Now each view can have a “preview mode” which shows a minimized version of the slice to which is binded. For example you can show in your home page a short version of a news linking to the complete one, or you can show the thumbnail of an image and link to the full version. This can be quite useful in some situations and can be triggered by setting preview=1 inside a slice group. Each slice inside the group will render in preview mode. Also the Remote Disk feature has been implemented and can be accessed as /rdisk. Inside this file manager you will be able […]