Html to plain text using webrat and nokogiri
Here is a snippet to parse a given http response into plain text. Basically it removes html tags, css blocks, script tags and yield visible text elements as seen in browser.
Gives:
Daily Blockers #1
I am starting a series of posts dealing with blockers at work. Here is the first one using gem bundler on Snow Leopard and mysql Mac OS X 10.5 (x86_64) version.
Command:
Error:
Solution:
Compile the bundled mysql gem with correct options. That is, locate your mysql_config and create a bundler_config.yml in application root dir.
Run:
Using AutoComplete with ActiveScaffold forms
This is a quick guide to set up auto_complete text fields in forms rendered by ActiveScaffold plugin.
I am not a huge fan of ActiveScaffold, but found these steps worth publishing after doing this for one typical project requirement.
1. Models
2. Install ActiveScaffold and AutoComplete Plugins
3. Controller Configuration
This renders a drop down list for country field, instead of the default create/replace form. However, we need to render an auto completing text box for which we need to replace the form column.
4. Form column override
Next step is to override the form column. Create a file named _country_form_column.html.erb in app/views/cities folder.
The second option :method => :get is needed to avoid the InvalidAuthenticityToken error generated by the ajax post request.
5. Since the form now returns country[name] instead of record[country_id] in params, we need to assign country object before creating city record. The CitiesController finally looks like:
Tweetdeck on mimo-740
Having tweetdeck open on same workspace often cause distractions during work. This even made me to abstain from using twitter for last two weeks. Now I have a setup of a special device for twitter in the form of Mimo 740 7″ Touchscreen monitor. I was impressed with the features packed in this device and that too in affordable price (150£). Although the mimo website shows ‘out of stock’ for this model, it is still available for sale on amazon and play.
I have always loved adding monitors to my notebook, but this model offers features of more than just a monitor. I find it most suitable as a secondary monitor for my macbook, dedicated for tweetdeck. The best part is, you need not worry about video cards and graphic ports for your machine, as it connects using the standard USB port (without using external power supply) and works with XP/Vista/OSX. The user experience with the touchscreen is decent but certainly not comparable to that of iPhones. You can switch between replies/direct messages/facebook status updates, scroll the tweet list by dragging the scrollbar using the touch features. The main drawback is the size of UI controls with the traditional desktop applications (button size, scrollbar width etc) which make it slightly difficult to control using fingers.
The inbuild mic and camera helps to configure it as a portable skype device (of course with cords), which can be kept away from the computer and controlled using touch screen. Some more applications, which I found appropriate for use on this device are youtube (in full screen mode), a dedicated console/terminal while coding, Colloquy for IRC, iChat, etc. It would be interesting to see how people build applications targeted for such touch enabled devices to enrich the user experience for commonly used services.
Jobmigo - Real time job bookmarking on twitter
JobMigo.com, inspired from the ‘#rtjobs’ movement, is an application created to help people find and sort jobs using twitter. So what does Twitter have to do with finding a job? Twitter has also become a place where users have begun to post listings for job openings. There are many ways in which this is done in the “Twitterverse”. Some users are actually job portals, “tweeting” posts from their website for the benefit of anyone who is receiving the tweets.
One of these tags was especially of interest. #RTJOBS was a tag that was created especially for the ‘re-tweeting’ of posted jobs. This tag essentially solved the third reason for overload by allowing users to stay current by re-tweeting posts that were still relevant, and popular on Twitter. By tracking these posts we are also assuming that the community has some kind of valuable information to add relating to importance or relevance of the post simply by the action of tweeting that post.
There are plenty of search tools available to search for job related keywords in tweets. JobMigo doesn’t try to index all job related information on web, instead it tries to figure out which job posts are genuine and of real interest to people. Users can see which job post (posted url) was ‘the most discussed’ or ’shared’ among twitter users within a given time frame. Additionally, JobMigo enables users to search by date, locations and job types. It has some pretty smart logic to bookmark the final urls discussed in tweets along with a tagging of places (state, country) and job types.
JobMigo is an example for application of the text filtering and information processing tool, which is being developed right now. I’ll post more about the tool and its evolution soon.
Url: http://jobmigo.com
Follow Jobmigo on twitter: http://twitter.com/jobmigo
Team behind JobMigo.com: Anup Narkhede, Ebru Kivanc and Ranmini Perera.




