Creating Facebook Events with the new Graph API – using the Hyper-Graph Gem
For reference - this works, using the hyper-graph gem ==> http://github.com/chrisdinn/hyper-graph
(obviously these aren't real tokens or ids.)
>> token = facebook_page_access_token
=>"1400842345358094 |1e88b25657af773e5d1cd98-682730385|13043245686971963|f7887S-V4pk5a24566ahKOVDFk."
>>page_id = facebook_page_access_token.split('|').first
=>"1400842345358094"
>>graph = HyperGraph.new( token )
=> #
>>graph.post("#{page_id}/events", :name=>"dude", :description=>"awesome", :start_time=>'1215929160', :end_time=>'1215929160', :location=>'the phoenix')
=>{:id=>122527554461466} # DONE!!!!
i am at a loss for why i cannot post anything to facebook using mini_fb.
Announcing ‘TweetSack’, a new project from Indierockmedia
Indierockmedia is pleased to announce the (re)launch of TweetSack. The site is a joint diversion between Chris and Jerrod that aggregates and categorizes linked-to content from twitter, eliminating the short-url-itis that we all hate about tweets.
By 'watching' some tags, you will be given your own custom site navigation and a never ending, constantly updated stream of articles, blog posts, and content specific to your interests. We also provide a simple re-tweet tool for content you deem interesting enough that you would like to share with your friends.
Thats it for now. Check it out and let us know what you think.
Sync in style with Blavosync
When developing new features for existing (or new) applications, our UI people like to have some real content to use to optimize the design for an interface that works with the actual data. It's classic chicken and egg syndrome.
"I cant design that area because i dont know what the content is, but i cant put content there until i know what the design looks like." - designers everywhere
My solution to this problem has always been to make a dump from the production site and import it locally, then tar up the system directory and pull that down. This works great since i am comfortable with scp and ssh and the mysql command line interface. The ui guys are not comfortable with this, but they do know how to deploy using capistrano, so there are 2 potential solutions to this particular problem:
- Move into all of my coworkers offices, babysitting their database content and assets and loading these in for my command-line-fearing friends every time they need new data.
- Write a tool that allows my command-line-fearing friends to run a single command to get said assets and db. Something simple and built on existing battle tested tools. something as simple as cap local:sync.
Obviously #1 doesnt scale, so we'll hop right on to the second option. Introducing BlavoSync. I'll not reproduce the README here, but instead will go through basic setup and requirements.
Requirements:
- A reason to have your production stuff on your development machine.
- A production server running mysql and sshd.
- A valid $RAILS_ROOT/config/database.yml file with entries for both production and development.
- The latest capistrano2 and a valid $RAILS_ROOT/config/deploy.rb file with either a :domain or :rsync domain entry.
- The blavosync rubygem, available at http://gemcutter.org (sudo gem install blavosync).
Hopefully you already have a nice little app running somewhere that has some decent data and assets. In your $RAILS_ROOT/config/deploy.rb file add this line to the top:
require "blavosync/recipes"
In addition, ensure that you have an entry either for :domain or :rsync_domain like so:
set :domain, "my.awesomedomain.com"
or if you are using some custom deployment location:
set :rsync_domain, "my.awesomedomain.com"
This covers the basic requirements, on to usage. As long as your $RAILS_ROOT/config/deploy.rb file is working, the only action you need to take is to run the following on your local machine.
cap local:sync
This will dump the production database and load it into your local mysql database, defined in your $RAILS_ROOT/config/database.yml, and then rsync anything in your $RAILS_ROOT/shared/system directory on production into your $RAILS_ROOT/tmp directory in a new system directory. Once this is done, the $RAILS_ROOT/tmp/system directory will be symlinked into $RAILS_ROOT/public/system.
There are some considerations you should take before using this tool, such as do you have enough disk space or bandwidth to pull down all the assets. You may already have a $RAILS_ROOT/public/system directory full of assets, in which case if you want to keep those you should back them up somewhere and delete the system directory, otherwise the symlink may not work.
If you are on OSX you may need to enable FollowSymLinks in your virtualhost entry for these assets to be served by apache.
Upgrade to passenger 2.2.x on centos 4
If you've set all the APR/APU/APX paths and you are still having issues such as:
In file included from ext/boost/config/no_tr1/utility.hpp:21,
from ext/boost/config/select_stdlib_config.hpp:20,
---- LOTS AND LOTS OF LINES ----
ext/boost/weak_ptr.hpp:86: confused by earlier errors, bailing out
rake aborted!
Command failed with status (1): [g++ -Iext -Iext/common -fPIC -DLINUX=2 -D_...]
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/Rakefile:172:in `define_common_library_task'
(See full trace by running task with --trace)
You may just need to run:
yum install libstdc++-devel
New widgets posted
Indierockmedia has created dynamic widgets for RCA's Anti Flag and Science Record's Beat Union and Greeley Estates. Check them out, more stuff to come soon.
Also in the mix, we are currently re-vamping the image for Roadrunner Records.
Fix for MacBook Pro Keyboard Freezes
Apple has posted a fix for an issue that is not necessarily relevant to Rails or Ruby, but is certainly something that has affected Rails developers who are using Leopard. (Most of them i'm guessing.) This issue, which has plagued me since installing OS X 10.5, caused the keyboard to become unresponsive and was quite possibly the most frustrating issue i have encountered since the days of Mac OS 7 and all the unexpected crashes that inevitably led to the old standbys. "Reset the PRAM." (wtf is pram?) "Rebuild the Desktop" (wtf do i look like? a carpenter?).
Get the fix here Apple MacBook Pro Software Update
Rails 2.0.2 Released: Sqlite3 now default database
In a move that makes setting up your first rails application so much simpler, Rails 2.0.2 now uses sqlite3 as the default database. Developing rapid prototypes can now be developed much more rapidly as sqlite3 is included in OSX 10.5 Leopard. This basically amounts to a zero configuration setup to get your app up and running. For more information see DHH's post.
validates_as_phone Ruby on Rails Plugin
I have collected and released validates_as_phone, a plugin to validate US formatted Phone Numbers.you can install the plugin as such:
script/plugin install http://validates-as-phone.googlecode.com/svn/trunk
The plugin includes tests. Feedback is welcome.
Usage: class Model < ActiveRecord::Base validates_as_phone :telephone, :message => "is not a valid US phone number" end
Extract Binary File & Images from MySQL to Filesystem with Ruby
Today i needed to extract some images that had (unwisely) been stored as BLOB in a mysql (imported from MS-SQL) database. Here is how i extracted the files to my filesystem using the console & ActiveRecord. You ARE using the console aren't you?Assuming the column holding the binary data is called picture_bin and your Model is called Picture:
Picture.find(:all).each do |f|
File.open(File.join(RAILS_ROOT, "photos", "#{f.id}.jpg"), "w") do |file|
file.write(f.picture_bin)
end
end
And if you're using file_column, assigning the image back to the record is as easy as:
Picture.find(:all).each do |f|
f.filename = File.open(File.join(RAILS_ROOT, "photos", "#{f.id}.jpg"), "r")
f.save
end
Welcome to the Blog
Indierockmedia was started by Mikey and I in 2003 to meet a growing need from independent labels & bands to manage their online presence without the need for in house "HTML nerds". What started out as a weekend project quickly became sole employment for our small but passionate duo. Since those early days, holed up in an apartment editing Rainer Maria and Mates of State footage, we have grown into a diverse collective which represents the best talent we have encountered over the years. We each bring a unique perspective on the music industry as well as design and development to the table, but the one passion we all share is for the music.
