PEAK XOOPS - Events feeds? in englishin japanese

Events feeds?

  • You cannot open a new topic into this forum
  • Guests cannot post into this forum

question Events feeds?

msg# 1
Previous post - Next post | Parent - Children.1 .2 | Posted on 2004/9/21 0:38
joeblow  办霹始   Posts: 19
heya. just started toying around with piCal. great modules! i have an odd requests.

is there a way to rss feed out events? either within this module or possibly with the RSSfit module? has anyone done this? is it possible?
Votes:0 Average:0.00
Previous post - Next post | Parent - No child | Posted on 2004/9/23 6:01
joeblow  办霹始   Posts: 19
anyone?
Votes:1 Average:10.00
Previous post - Next post | Parent - No child | Posted on 2004/10/9 1:21
kazuki  企霹始   Posts: 3
I asked the same question a while ago. I think it'll be included in future releases. So I did some primitive hacks on my site to provide RSS feed. Shown below is what I did.

SUMMARY
piCal ----> .ics(iCalendar-format) file
.ics ----> PHP iCalendar
PHP iCalendar ----> RSS feed

My server creates an iCalendar-format calendar file from the piCal web interface automatically with the shell script shown below. It's activated via cron. I's pretty odd, but shell scripting is the only programming method that I have some experience with.

######Shell Script to Create iCalendar-format Calendar File #####
#!/bin/sh

#URL at which 100 events from now are shown
URLHUNDRED='http://site.name/xoops.dir/modules/piCal/index.php?smode=List&num=100'

#Output iCalendar file
ICSHUNDRED='/PHP_iCalendar_Directory/calendars/events.ics'

# tmp file saving event_ids
PARSEDID='/tmp/parsed.event_id.txt'


### parser() $1(URL) $2(Output ids) Activated by ics_gen()###
### obtains event_ids shown in the $URL, save them in $PARSEDID
parser()
{
#echo $1 $2

wget -q $1 -O - |\
\
tr \< \\n |\
grep "action=View&event_id" |\
\
tr \= \\n |\
tr \' \\n |\
\
grep "^[0-9]*[0-9]$" |\
\
sort -u |\
\
sed -e 's/^/event_ids%5B%5D=/' \
-e 's/$/output_ics=iCalendar%28Win%29/' |\
\
tr \\n \& |\
\
sed -e 's/$/output_ics=iCalendar%28Win%29/' \
> $2

return
}
### /parser() $1(URL) $2(Output ids) ###


### ics_gen() $1(URL) $2(Output ics) ###
### Using event_ids in $PARSEDID, request iCalendar-format event information
### Utilizes POST request function of curl (-d option)
ics_gen()
{
parser "$1" "${PARSEDID}" ### Activates parser()

curl --silent \
-d `cat ${PARSEDID}` \
--url http://site.name/xoops.dir/modules/piCal/ \
> $2

return
}
### /ics_gen() $1(URL) $2(Output txt) $3(Output ics) ###


### Generates .ics files utilizing ics_gen() and parser()

ics_gen $URLHUNDRED $ICSHUNDRED


exit

#### Script Ends Here ####

Then the iCalendar-format calendar is read by PHP iCalendar ( http://phpicalendar.net/forums/ ), which does have RSS feed function. (You'll have to put the .ics file in the "calendars" directory in the PHP iCalendar parent directory.)

You just access iCalendar page which is showing the content of .ics file created by the script.

The RSS feed will be very crude, but I don't really mind. If someone can improve the methods, I would appreciate it.
Votes:0 Average:0.00

  Advanced search


Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!