Forum: Ruby on Rails Facebooker cannot post event

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
ArtÅ«ras Å. (Guest)
on 2009-02-15 20:47
I'm trying to do it with this code:

  def create_event(options={})
    options.assert_valid_keys(:uid, :event)
    session = create_session
    event = options[:event]
    # Note: The start_time and end_time are the times that were input by
the event creator,
    # converted to UTC after assuming that they were in Pacific time
(Daylight Savings or
    # Standard, depending on the date of the event), then converted into
Unix epoch time.
    # Basically this means for some reason facebook does not want to get
epoch timestamps
    # here, but rather something like epoch timestamp minus 7 or 8
hours, depeding on the
    # date. have fun!
    #
    # http://wiki.developers.facebook.com/index.php/Events.create
    start_time = (event.start - 10.hours).utc.to_i
    end_time = event.end ? (event.end - 10.hours).utc.to_i : start_time

    session.post("events.create", {
      'event_info' => {
        'name' => event.title,
        'category' => event.facebook_category.to_s,
        'subcategory' => event.facebook_subcategory.to_s,
        'host' => event.organizers.blank? ? event.place.title :
event.organizers_as_string,
        'location' => event.place.title,
        'street' => event.place.address,
        'city' => event.city.to_s,
        'description' => event.description || '',
        'privacy_type' => 'SECRET',
        'start_time' => start_time,
        'end_time' => end_time
      }.to_json
    })
  end

However..

c:/ruby/lib/ruby/gems/1.8/gems/mmangino-facebooker-1.0.12/lib/facebooker/parser.
rb:487:in `process': event_info parameter: array expected.
(Facebooker::Session:
:MissingOrInvalidParameter)

Any ideas on what's happening? :|
Akhilesh S. (Guest)
on 2009-04-20 10:37
hi dude,
i am also facing the same problem of creating event using facebooker and
doesn't get anything useful. Are you able to solve this issue. if yes
then please help me out by providing the way you took to solve that.

Regards,
Akhilesh sharma
removed_email_address@domain.invalid

Artūras Šlajus wrote:
> I'm trying to do it with this code:
>
>   def create_event(options={})
>     options.assert_valid_keys(:uid, :event)
>     session = create_session
>     event = options[:event]
>     # Note: The start_time and end_time are the times that were input by
> the event creator,
>     # converted to UTC after assuming that they were in Pacific time
> (Daylight Savings or
>     # Standard, depending on the date of the event), then converted into
> Unix epoch time.
>     # Basically this means for some reason facebook does not want to get
> epoch timestamps
>     # here, but rather something like epoch timestamp minus 7 or 8
> hours, depeding on the
>     # date. have fun!
>     #
>     # http://wiki.developers.facebook.com/index.php/Events.create
>     start_time = (event.start - 10.hours).utc.to_i
>     end_time = event.end ? (event.end - 10.hours).utc.to_i : start_time
>
>     session.post("events.create", {
>       'event_info' => {
>         'name' => event.title,
>         'category' => event.facebook_category.to_s,
>         'subcategory' => event.facebook_subcategory.to_s,
>         'host' => event.organizers.blank? ? event.place.title :
> event.organizers_as_string,
>         'location' => event.place.title,
>         'street' => event.place.address,
>         'city' => event.city.to_s,
>         'description' => event.description || '',
>         'privacy_type' => 'SECRET',
>         'start_time' => start_time,
>         'end_time' => end_time
>       }.to_json
>     })
>   end
>
> However..
>
> c:/ruby/lib/ruby/gems/1.8/gems/mmangino-facebooker-1.0.12/lib/facebooker/parser.
> rb:487:in `process': event_info parameter: array expected.
> (Facebooker::Session:
> :MissingOrInvalidParameter)
>
> Any ideas on what's happening? :|
ArtÅ«ras Å. (Guest)
on 2009-04-22 15:28
Attachment: facebook_worker.rb (0 Bytes)
Akhilesh Sharma wrote:
> hi dude,
> i am also facing the same problem of creating event using facebooker and
> doesn't get anything useful. Are you able to solve this issue. if yes
> then please help me out by providing the way you took to solve that.

Hey, yeah, I solved it :)

Attaching my FacebookWorker that posts events to facebook.
ArtÅ«ras Å. (Guest)
on 2009-04-22 15:31
Artūras Šlajus wrote:
> Akhilesh Sharma wrote:
>> hi dude,
>> i am also facing the same problem of creating event using facebooker and
>> doesn't get anything useful. Are you able to solve this issue. if yes
>> then please help me out by providing the way you took to solve that.
>
> Hey, yeah, I solved it :)
>
> Attaching my FacebookWorker that posts events to facebook.

BTW, it seems that host key was the problem. It had something to do with
facebook returning stupid error messages when not recognizing event_info
keys. I actually tried bare minimum while I got to working set.
Akhilesh S. (Guest)
on 2009-04-23 10:44
(Received via mailing list)
thanks for valuable inputs, but still not sure how to use this
Facebook Worker.
I am using facebooker plugin of rubyonrails for communicating to
facebook, now how to include your facebookWorker to communicate to
facebook.
Please help me with some sniplet of code, or some reference docs.

Thanks for your help.


On Apr 22, 4:31 pm, Artûras Ðlajus <removed_email_address@domain.invalid>
ArtÅ«ras Å. (Guest)
on 2009-04-23 14:23
Akhilesh Sharma wrote:
> thanks for valuable inputs, but still not sure how to use this
> Facebook Worker.
> I am using facebooker plugin of rubyonrails for communicating to
> facebook, now how to include your facebookWorker to communicate to
> facebook.
> Please help me with some sniplet of code, or some reference docs.
It's a part of my code, the important thing is event_info. Don't use
'host' key and you should be ok.
Akhilesh S. (Guest)
on 2009-04-23 16:01
(Received via mailing list)
thanks again for ur input,
i will give it a try and revert back to u.
hope everything gonna be fine.


On Apr 23, 3:23 pm, Artûras Ðlajus <removed_email_address@domain.invalid>
This topic is locked and can not be replied to.