Modified Facebook FBCal to show private events in Gmail Calendar


Recommended Posts

Hi,

Firstly, apologies to mods if this is in the wrong place. I've spent a bit of time modifying the code from gsellis.com (http://www.gsellis.com/2009/06/fbcal/) to solve a common problem and thought I'd post it here in case others want to use it.

There is a known problem with Google Calendar (gCal) and Facebook (FB) whereby private events in Facebook simply show up as "busy" entries in gCal when exported. This is frustrating since the iCal file contains all the data and gCal simply displays it wrong. Gsellis wrote code to obtain the iCal file from FB, set all private flags to public and then output a new iCal file which gCal displayed correctly.

However, I didn't want to just use the FB iCal file as it doesn't show past events and you can't choose whether or not to see events you're not attending / haven't replied to yet. These features are offered by a handy FB app called "FBcal" but the 'private events showing as busy' problem arises again. Therefore, I found a solution using this code:

**Save in a file on your hosting - e.g. cal.php**Add calendar by url in gCal: http://www.yourhost.com/cal.php**

<?php
$ical="**The URL given to you by FBCal - unique for each user and choice of display options**";
$file=file_get_contents($ical);
$search="CLASS:CONFIDENTIAL";
$replace="CLASS:PUBLIC";
$output=str_replace($search,$replace,$file);
header("Content-Type: text/Calendar");
// Give the file a name and force download
header("Content-Disposition: inline; filename=events.ics");
print_r($output);
?>

This requires the FBCal link to be hardcoded as I wasn't sure of the format it took. Mine was:

http://www.fbcal.com/cal/{UID}/40d32f39d2721c1582498520-{UID}/events/ics/attending,unsure/tz/Europe-Dublin

where UID is a unique user ID given in the simple facebook export events link when you login to FB. The facebook link also includes a key, but I'm not sure how this relates to the other string of characters in the link.

So, if other people have had this problem and want to work out how to make it into a general script which can be hosted once and used by many people then that's fine. Equally, if no-one has had this problem and it's just me being picky with my calendar preferences then feel free to consign this to the bin!

EDIT: Just realised the title should be Google Calendar, not Gmail calendar... perhaps a mod could change it to "How to modify Facebook app 'FBCal' to properly display private events in Google Calendar" - Thanks!

  • 3 weeks later...
  • 3 weeks later...
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • I don't use Edge, I don't even use Windows these days as my main driver. Mac these days I use and Zen browser
    • Apple releases iOS 26.5.2 with dozens of security fixes for iPhone by Karthik Mudaliar Apple has released iOS 26.5.2 and iPadOS 26.5.2, which are security-only updates for the iPhone and the iPad. The update brings a bunch of security fixes for WebKit, WebRTC, WebKit Storage, WebKit Canvas, Web Extensions, libxslt, IOGPUFamily, and even the kernel. Some of the WebKit issues that were fixed could have allowed malicious web content to disclose sensitive user information, exfiltrate cross-origin data, crash Safari, or process restricted web content outside the browser sandbox. One notable WebKit Storage bug could let a malicious website to silently hijack clipboard data, according to Apple’s description. Other WebKit-related flaws involved memory corruption, use-after-free bugs, type confusion, out-of-bounds writes, permissions problems, and cross-origin data handling issues. The update also includes three kernel-related fixes. Apple says one of the flaws could let an app write kernel memory or cause unexpected system termination, while another may leak sensitive kernel state, and a third could corrupt kernel memory or terminate the system unexpectedly. Although Apple hasn't described them as remote web attacks, kernel bugs are still important to fix, as they can sometimes be chained with other flaws to escape app or browser restrictions. The updates are available for iPhone 11 and later, iPad Pro 12.9-inch 3rd generation and later, iPad Pro 11-inch 1st generation and later, iPad Air 3rd generation and later, iPad 8th generation and later, and iPad mini 5th generation and later. Similar security fixes also came with the latest update to macOS Tahoe 26.5.2, which Apple released on the same day. That overlap is not surprising, since Safari, WebKit, WebRTC, and other underlying components are shared across Apple’s platforms. Users are advised to update their devices sooner rather than later as these security fixes are crucial. iOS 26.5.2 can be installed from Settings > General > Software Update. Similarly, Mac users can find macOS Tahoe 26.5.2 through System Settings > General > Software Update.
    • Taken them long enough, that is one good thing. I still refuse to have a Whatsapp account, because it still need a phone number to have an account. don't want to give Meta my phone number
    • Good think I still have SDRAM and FP RAM sitting around.
    • Fitbit Charge 6 fitness tracker with Google apps is now at its lowest price with 47% off by Fiza Ali Amazon is currently offering the Fitbit Charge 6 fitness tracker at its all-time low price with a 47% discount. The device features an AMOLED touchscreen display protected by Corning Gorilla Glass 3 that should offer improved scratch resistance and durability. The Charge 6 is equipped with a range of sensors including an optical heart rate sensor, a 3-axis accelerometer, built-in GPS with GLONASS support, red and infrared sensors for SpO2 monitoring, a skin temperature sensor, an ambient light sensor, a vibration motor, NFC, and multipurpose electrical sensors compatible with the ECG and EDA Scan apps. Heart rate is recorded every second during exercise tracking and every five seconds during normal daily use. The device requires the Google Health app for setup and synchronisation. Furthermore, Bluetooth provides wireless connectivity for syncing and communication with devices running Apple iOS 16.4 or later and Android 11.0 or later. The tracker stores up to 7 days of minute-by-minute activity data and retains daily activity totals for the previous 30 days. In terms of water resistance, the Fitbit Charge 6 has a 5 ATM rating that should make it suitable for swimming and water activities. The tracker operates in temperatures ranging from 14°F to 113°F and at altitudes of up to 28,000 feet. Moreover, the included Infinity band is made from a flexible silicone material and features a loop-and-peg fastening. The small band fits wrists measuring 5.1 to 6.7 inches, while the large band fits wrists measuring 6.7 to 8.3 inches. Both small and large bands are included in the box. When it comes to battery performance, the Fitbit Charge 6 should deliver up to 7 days of battery life under typical usage conditions. Features such as the Always-On Display, built-in GPS, and SpO2 monitoring increase power consumption and may require more frequent charging. The rechargeable lithium-polymer battery should take approximately two hours to charge from empty to full. Fitbit Charge 6 Fitness Tracker with Google Apps: $85.45 (Amazon US) - 47% off Good to know This Amazon deal is U.S. specific, and not available in other regions unless specified. We only use first-party seller links (at the time of article publishing); ensure that you purchase from a first-party seller link only. Check out Today's Deals on Amazon | or our recent tech deals. Become a Prime member (for Students or SNAP) via Neowin Get Prime Access - Prime for half price (for qualifying Medicaid, EBT, SNAP) Subscribe to Prime Video, Audible Plus, Music Unlimited or Kindle Unlimited via Neowin As an Amazon Associate, we earn from qualifying purchases.
  • Recent Achievements

    • Reacting Well
      NovaEdgeX earned a badge
      Reacting Well
    • Week One Done
      NovaEdgeX earned a badge
      Week One Done
    • One Year In
      BA the Curmudgeon earned a badge
      One Year In
    • Conversation Starter
      rosiecharles earned a badge
      Conversation Starter
    • First Post
      KMilenkoski1202 earned a badge
      First Post
  • Popular Contributors

    1. 1
      +primortal
      536
    2. 2
      +Edouard
      266
    3. 3
      PsYcHoKiLLa
      150
    4. 4
      Steven P.
      98
    5. 5
      macoman
      61
  • Tell a friend

    Love Neowin? Tell a friend!