# Facebooker cannot post event

**URL:** <https://www.ruby-forum.com/t/facebooker-cannot-post-event/160386>\
**Category:** Rails\
**Created:** [February 15, 2009, 7:47pm UTC](https://www.ruby-forum.com/t/facebooker-cannot-post-event/160386 "2009-02-15T19:47:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![arturaz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/73ab20/32.png) [@arturaz](https://www.ruby-forum.com/u/arturaz)\
**Post date:** [February 15, 2009, 7:47pm UTC](https://www.ruby-forum.com/t/facebooker-cannot-post-event/160386/1 "2009-02-15T19:47:43Z")

</div>

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](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? 😑

---

<div class="post-metadata">

**Author:** ![arturaz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/73ab20/32.png) [@arturaz](https://www.ruby-forum.com/u/arturaz)\
**Post date:** [April 20, 2009, 8:37am UTC](https://www.ruby-forum.com/t/facebooker-cannot-post-event/160386/2 "2009-04-20T08:37:01Z")

</div>

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](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? 😑

---

<div class="post-metadata">

**Author:** ![arturaz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/73ab20/32.png) [@arturaz](https://www.ruby-forum.com/u/arturaz)\
**Post date:** [April 22, 2009, 1:31pm UTC](https://www.ruby-forum.com/t/facebooker-cannot-post-event/160386/3 "2009-04-22T13:31:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![arturaz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/73ab20/32.png) [@arturaz](https://www.ruby-forum.com/u/arturaz)\
**Post date:** [April 23, 2009, 8:44am UTC](https://www.ruby-forum.com/t/facebooker-cannot-post-event/160386/4 "2009-04-23T08:44:07Z")

</div>

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](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![arturaz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/73ab20/32.png) [@arturaz](https://www.ruby-forum.com/u/arturaz)\
**Post date:** [April 23, 2009, 12:23pm UTC](https://www.ruby-forum.com/t/facebooker-cannot-post-event/160386/5 "2009-04-23T12:23:57Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![arturaz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/73ab20/32.png) [@arturaz](https://www.ruby-forum.com/u/arturaz)\
**Post date:** [April 23, 2009, 2:01pm UTC](https://www.ruby-forum.com/t/facebooker-cannot-post-event/160386/6 "2009-04-23T14:01:36Z")

</div>

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](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![arturaz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/73ab20/32.png) [@arturaz](https://www.ruby-forum.com/u/arturaz)\
**Post date:** [April 22, 2009, 1:28pm UTC](https://www.ruby-forum.com/t/facebooker-cannot-post-event/160386/7 "2009-04-22T13:28:40Z")

</div>

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.
