tel8618217223380 / restylegc

Automatically exported from code.google.com/p/restylegc
0 stars 0 forks source link

Moved Temporarily - The document has moved here. #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Attempt to use iframe and embed calendar.   
2.
3.

What is the expected output? What do you see instead?
Don't see calendar.  Comes up with:
Moved Temporarily
The document has moved here.

What version of the product are you using? On what operating system?
restyle 1.0

Please provide any additional information below.
Has been working great except I made no changes an now get Moved
Temporarily message.  If you refresh enough it will show up.  I tried
wphampton's script if you get this message.  However even changing the loop
to run 40 times, some times won't get it to display correctly.

Original issue reported on code.google.com by ewett...@gmail.com on 13 Dec 2009 at 2:07

GoogleCodeExporter commented 9 years ago
I am also having the same problem and have seen the workaround on the 
troubleshooting
page but would like a more permanent solution.

Original comment by yvonn...@gmail.com on 13 Dec 2009 at 3:55

GoogleCodeExporter commented 9 years ago
Anyone experiencing this problem on a regular basis, could you please provide 
the
value of the iframe src attribute you are using?  I am unable to reproduce this 
problem.

Original comment by brian.gi...@gmail.com on 13 Dec 2009 at 10:48

GoogleCodeExporter commented 9 years ago
Also try this:

In restylegc.php, in the section "// Request a calendar" lines 115-119, insert

curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); // follow redirects
curl_setopt($ch, CURLOPT_MAXREDIRS, 10); // maximum number of redirects

Original comment by brian.gi...@gmail.com on 13 Dec 2009 at 11:08

GoogleCodeExporter commented 9 years ago
http://jastudents.org/jaweb/cal/restylegc/restylegc.php?src=jacksonacademy.org_a
qkucg915aja2sqmo8334qigvo%40group.calendar.google.com

In the link above I have included the workaround mentioned in this post.  I
previously was using the one in the wiki, but both seem to render same results. 
 I
had to increase the MAXREDIRS to about 30 to even get it to show up every once 
in a
while.

Thanks for your help.

Original comment by ewett...@gmail.com on 13 Dec 2009 at 11:24

GoogleCodeExporter commented 9 years ago
This is my iframe code:

<iframe
src="/restylegc/restylegc.php?title=SWSF%20Mensa%20Calendar&showPrint=0&showCale
ndars=0&showTz=0&height=600&wkst=1&bgcolor=%23FFFFFF&src=swsf.mensa%40gmail.com&
color=%231B887A&src=usa__en%40holiday.calendar.google.com&color=%238D6F47&ctz=Am
erica%2FNew_York"
style=" border-width:0 " width="800" height="600" frameborder="0"
scrolling="no"></iframe>

I have implemented the workaround and had to up the retry value to 40. The 
problem
still occurs about half the time.

Original comment by yvonn...@gmail.com on 14 Dec 2009 at 2:07

GoogleCodeExporter commented 9 years ago
By the way, if you use the link provided by the "Moved temporarily", the 
calendar you
are shown has none of the formatting that restyle provides.

Original comment by yvonn...@gmail.com on 14 Dec 2009 at 8:12

GoogleCodeExporter commented 9 years ago
@ewettach

I had no problem loading your calendar locally.  However, clicking on the link 
you
provided results in a blank page.  Make sure you're not getting any PHP errors:
http://itslennysfault.com/force-php-to-show-all-errors-or-save-them-to-a-log-for
-trouble-shooting

@yvonne.r

In your case, try replacing the & with just &. I was able to get the Moved
Temporarily message to disppear by doing that.  I know technically you want to 
use
&, but try it without.  With & in place along with the workaround, I get
redirected to a Google login form.  Please also make sure your calendars are 
public.

Original comment by brian.gi...@gmail.com on 14 Dec 2009 at 8:29

GoogleCodeExporter commented 9 years ago
@brian.gibson

There is no question that this calendar is public. I double checked just in 
case but
I know that my visitors are able to see it as I have seen them access it from 
their
phones.

I hate having to take the & out as it makes my page XHTML invalid but will do so
for the sake of pretty.

So I made the changes suggested, it still doesn't work. After 7 tries I have 
yet to
be able to load the page at all. It seems the suggestion to take out the $amp; 
made
it worse.

Original comment by yvonn...@gmail.com on 14 Dec 2009 at 8:45

GoogleCodeExporter commented 9 years ago
Note, I put the $amp; back in and I am still unable to load the page at all. So 
the
suggestion did not make it worse but it didn't make it better either. Not sure 
what
is happening at the moment that the calendar will not load at all.

Original comment by yvonn...@gmail.com on 14 Dec 2009 at 8:48

GoogleCodeExporter commented 9 years ago
I am getting this same error. However this is the link that it redicretcs me 
too: 

https://www.google.com/accounts/ServiceLogin?service=cl&passive=true&nui=1&conti
nue=http%3A%2F%2Fwww.google.com%2Fcalendar%2Fembed%3Fsrc%3Dadrianghawkins%40gmai
l.com&followup=http%3A%2F%2Fwww.google.com%2Fcalendar%2Fembed%3Fsrc%3Dadrianghaw
kins%40gmail.com&btmpl=mobile<mpl=mobileh

Original comment by adriangh...@gmail.com on 16 Dec 2009 at 5:47

GoogleCodeExporter commented 9 years ago
I'm still unable to reliably reproduce the problem on my local machine or on my 
host.
 I wonder if this is because of the hosting provider.  If you're experiencing this
problem, perhaps your host is behind a proxy, or there is some other network 
issue. 
If you have access to another hosting provider, I suggest testing the script 
there. 
If it works, you can use the script at that host.  Because the calendar is 
embedded
inside an iframe, there is no requirement that the script must be hosted on the 
same
server as the website.  

Also with my suggested workaround (which appears to be hit or miss for some 
people),
I forgot about restylegc-js.php.  It too uses curl, so when trying the 
workaround put
the lines not just in restylegc.php but also restylegc-js.php.  Please report 
your
results.

Original comment by brian.gi...@gmail.com on 20 Dec 2009 at 4:17

GoogleCodeExporter commented 9 years ago
It started working again by itself. Perhaps there were general Google issues 
before.

Original comment by yvonn...@gmail.com on 1 Jan 2010 at 9:18

GoogleCodeExporter commented 9 years ago
I had this issue, it "seems" to work now after the above mentioned fix... for 
now. I
had to make sure I was logged out of google and the problem was not solved when 
I
tried to browse the calendar outside of the Iframe. Again the fix only worked 
inside
the iframe... odd.

Original comment by lucasro...@gmail.com on 17 Jan 2010 at 11:39

GoogleCodeExporter commented 9 years ago
I just found your script and installed and had everything working fine, and 
then all
of a sudden got the same "Moved Temporarily" message as stated above. It 
happened
when I tried to view the page with the embedded calendar in Safari, and then 
when I
went back to FireFox, it too had the "Moved temporarily" message where before 
it did
not...

When I click on the Moved temporarily it shows me the calendar, but with the 
message
"Events from one or more calendars could not be shown here because you do not 
have
the permission to view them." I've triple checked that the calendar is shared, 
logged
in and out with different accounts, tried different browsers, but still get the 
same
thing. Any ideas? Interesting side note, when I tried clicking on the "moved
temporarily" link with Google Chrome for Mac, it asked me to log in. Does this 
only
work if a user is signed into a google account? That doesn't seem right.

Haven't tried the workarounds here yet, and I'm hesitant to since there seems 
to have
been mixed results. Any update on a permanent solution to this? Also, I added 
the
google calendar iframe that goes directly to google instead of using restylegc 
on
this page, and it works fine every time, while the restylegc calendar has 
problems.

I'm using restylegc version 1.0.2

Any help would be greatly appreciated, thank you!

Original comment by edgarper...@gmail.com on 24 Feb 2010 at 11:54

GoogleCodeExporter commented 9 years ago
I'm experiencing the same problem as other people in this thread. If I use & in
the URL I constantly get the "Moved Temporarily" message while if I replace 
them with
normal ampersands (&) it works randomly. I've tried all of the fixes in this 
thread
to no avail. Is this project dead?

I wouldn't mind using google's native embedding feature. If only they allowed 
you to
change the padding and remove that huge/ugly blue border :(

Original comment by jaredb...@gmail.com on 10 Apr 2010 at 12:03

GoogleCodeExporter commented 9 years ago
Thread on the subject
http://groups.google.com/group/restylegc/browse_thread/thread/17f5a5cb2c83214c

Comment section on troubleshooting page has some suggestions
http://code.google.com/p/restylegc/wiki/Troubleshooting

I am unable to reproduce this problem reliably and as a consequence I cannot 
provide
a solution.  So this issue remains open.  People have had success with one or 
more
suggestions listed here and the other two links above.

Original comment by brian.gi...@gmail.com on 10 Apr 2010 at 5:36

GoogleCodeExporter commented 9 years ago
I had this issue for a calendar that was hosted on a Google Apps account.  I 
solved 
it by creating an embed frame from within GC, and extracting the src from that 
code.  
Using the user%40domain.tld suggested always returned the Moved Temporarily.

The src that worked was (purposefully obscured):
src=domain.tld_1r8miabrfl1f0864isbrqbcg78%40group.calendar.google.com

So that may give you something to look for.

Thank you for such an amazing tool!!!

Original comment by TravisLe...@gmail.com on 15 Apr 2010 at 4:04

GoogleCodeExporter commented 9 years ago
Oh, I also modified the URL before the "embed" part, but I don't know if that's 
necessary.

Original comment by TravisLe...@gmail.com on 15 Apr 2010 at 5:50

GoogleCodeExporter commented 9 years ago
any one having solution ?

Original comment by piyushn...@gmail.com on 27 Aug 2010 at 9:00

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
piyushnp88, read this thread: 
http://groups.google.com/group/restylegc/browse_thread/thread/17f5a5cb2c83214c?p
li=1

Wes suggests rearranging the URL parameters, specifically moving the 'src' 
attribute to the front. It worked for me.

Original comment by nik.n...@gmail.com on 31 Aug 2010 at 3:20

GoogleCodeExporter commented 9 years ago
I forked this project on Github with multiple protections against this error
 - simple file caching (2 hour update)
 - follow redirects in cURL (suggested above)
 - regex testing against "Temporarily Moved" - will loop through up to 10 times till it gets the calendar itself

http://github.com/amites/RESTYLEgc

also swapped out dojo with jquery (personal preference)

also attached in case you're lazy and don't want to visit another site

Original comment by alvin.mi...@gmail.com on 17 Sep 2010 at 3:14

Attachments:

GoogleCodeExporter commented 9 years ago
I have a bit of a different issue...
I get "Moved Temporarily" on this page 'www.kingrowla.com/soundbreakers.html' 
and that's fine, just annoying.

I them implemented 
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); // follow redirects
curl_setopt($ch, CURLOPT_MAXREDIRS, 20); // maximum number of redirects

and I get rid of the Move Temporarily page, but, my calendar shows in spanish 
or whatever the language is...

'www.kingrowla.com/soundbreakers_b.html'

any ideas what might be causing this? Thank you.

PS I check all language settings in google calendar and all are set to english.

Original comment by kingro...@gmail.com on 19 Sep 2010 at 7:33

GoogleCodeExporter commented 9 years ago
Another workaround people can try is replacing 

$buffer = curl_exec($ch);
curl_close($ch);

with

$buffer = curl_exec($ch);
while(curl_getinfo($ch, CURLINFO_HTTP_CODE) == 302) {
    $buffer = curl_exec($ch);
}
curl_close($ch);

Essentially, this forces a continuous reload of the page rather than following 
redirects.  I suspect that Google's servers are in a state of flux where some 
can serve the calendar correctly while others cannot which would explain while 
the problem is intermittent and only experience by some and not others.  By 
forcing the reload, you should eventually hit a working server.  It's crude, 
but it does avoid guessing the max number of redirects needed.  There is a 
danger of getting an infinite loop which you can avoid by setting a counter and 
checking if the counter reaches some max number (like a 1000) but then it's 
almost no different than following redirects a maximum number of times.

Original comment by brian.gi...@gmail.com on 19 Sep 2010 at 8:41

GoogleCodeExporter commented 9 years ago
there is an option to set the max redirections count in curl...

// Set Max redirects
curl_setopt($ch, CURLOPT_MAXREDIRS, 3]);

Original comment by tanguy.pruvot@gmail.com on 28 Sep 2010 at 7:53

GoogleCodeExporter commented 9 years ago
arf, dont have seen comment 23 :p

Original comment by tanguy.pruvot@gmail.com on 28 Sep 2010 at 7:53

GoogleCodeExporter commented 9 years ago
so in restylegc.php :

--- restylegc/restylegc.php Tue Sep 28 09:56:11 2010
+++ restylegc/restylegc.php Tue Sep 28 09:55:08 2010
@@ -120,6 +120,8 @@
 curl_setopt($ch, CURLOPT_URL, $url);
 curl_setopt($ch, CURLOPT_HEADER, 0);
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); // follow redirects
+curl_setopt($ch, CURLOPT_MAXREDIRS, 3); // maximum number of redirects
 $buffer = curl_exec($ch);
 curl_close($ch);

Original comment by tanguy.pruvot@gmail.com on 28 Sep 2010 at 7:57

GoogleCodeExporter commented 9 years ago
I had this issue on a random refresh of the page (sometimes it worked, 
sometimes it gave the error message), but thanks to Brian's code...

$buffer = curl_exec($ch);
while(curl_getinfo($ch, CURLINFO_HTTP_CODE) == 302) {
    $buffer = curl_exec($ch);
}
curl_close($ch);

...it seems fine now.

Thanks.

Original comment by mahan...@gmail.com on 29 Sep 2010 at 1:05

GoogleCodeExporter commented 9 years ago
Brian's soluton: http://code.google.com/p/restylegc/issues/detail?id=12#c24

That worked like a treat... thankyou so much... my visitors kept getting the 
'Moved Temporarily' message which prevented then form seeing the upcoming dates.

All fixed now, thanks! :D

Original comment by j.christ...@bigpond.com on 11 Oct 2010 at 8:14

GoogleCodeExporter commented 9 years ago
That solution is not working for me, instead I get php error:
Fatal error: Maximum execution time of 60 seconds exceeded

Original comment by erik.b22@gmail.com on 13 Oct 2010 at 11:04

GoogleCodeExporter commented 9 years ago
The solutions here either do not work or are no longer working. Any help?

Original comment by Terminal...@gmail.com on 10 Nov 2010 at 11:35

GoogleCodeExporter commented 9 years ago
Yeah...as of today it seems the various pages I use this script are all 
displaying the "Moved Temporarily" error.  Even the example page for this 
project does...uh oh... Click on Example from the home page: 
http://www.restylegc.com/

Original comment by wphamp...@gmail.com on 10 Nov 2010 at 11:49

GoogleCodeExporter commented 9 years ago
I think I finally figured out what's going on.  I'm not sure why I didn't 
notice it before.  It looks like the reason Google Calendar responds with a 
HTTP 302 code is because it's redirecting to https://www.google.com/ to 
establish an SSL connection to the HTTP client.  Considering all the hubbub 
surrounding FireSheep, I'm not all that surprised.  So Google is going to force 
an SSL connection to Google Calendar even if the calendar is public and doesn't 
require authentication.  Enough of the explanation, here's the fix, on line 115:

Change from

  $url = "http://www.google.com/calendar/embed?" . $_SERVER['QUERY_STRING'];

to

  $url = "https://www.google.com/calendar/embed?" . $_SERVER['QUERY_STRING'];

If that's all there is to it, there's no need to configure curl to follow 
redirects or to continually poll Google in response to a 302 code.

I'd appreciate anyone to confirm this simple change fixes your problem, 
especially if it does so without any of the other fixes listed above.  If so, I 
may be able to finally close this issue and roll the change into an update.

Original comment by brian.gi...@gmail.com on 11 Nov 2010 at 6:43

GoogleCodeExporter commented 9 years ago
Oh and I forgot, add:

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

before line 123:

$buffer = curl_exec($ch);

Original comment by brian.gi...@gmail.com on 11 Nov 2010 at 6:46

GoogleCodeExporter commented 9 years ago
That fixed the issue for me even before you set curl_setopt. I was about to 
reply that your code worked when I saw your addition. Thanks for finding the 
solution. Also I commented out the previous fix that had the retries in it and 
all is good on my page. E-mail me if you want a link to the site where I use 
it. Thanks for responding so quickly.

Original comment by yvonn...@gmail.com on 11 Nov 2010 at 6:56

GoogleCodeExporter commented 9 years ago
This seems to have fixed it for me as well.

Original comment by hsamuel...@gmail.com on 11 Nov 2010 at 10:32

GoogleCodeExporter commented 9 years ago
Fixed for me too.

Thanks!

Original comment by xavierma...@gmail.com on 11 Nov 2010 at 11:46

GoogleCodeExporter commented 9 years ago
Genius!  Thanks Brian!  I had adjusted that for my HTTPS pages already (to 
avoid the "this page contains unsecure content" browser warning) but didn't 
catch that Google must now require an SSL connection always.  You are THE MAN!! 
 Good work!

Wes

Original comment by wphamp...@gmail.com on 11 Nov 2010 at 12:17

GoogleCodeExporter commented 9 years ago
Thanks Brian, fixed mine as well

Original comment by g...@jellyhaus.com on 12 Nov 2010 at 5:34

GoogleCodeExporter commented 9 years ago
Fixed in version 1.1.0

Original comment by brian.gi...@gmail.com on 14 Nov 2010 at 4:54

GoogleCodeExporter commented 9 years ago
Brian, you've made my day with 
http://code.google.com/p/restylegc/issues/detail?id=12#c24

have a nice day

Original comment by ora...@gmail.com on 12 Aug 2011 at 10:22

GoogleCodeExporter commented 9 years ago
Looks like this is down again.  I've tried all the recommended solutions, I 
still get the redirect.

Original comment by Williams...@gmail.com on 23 Nov 2011 at 11:13

GoogleCodeExporter commented 9 years ago
I am having this same issue.  Using the latest version (1.1.2).  Any hope of 
getting this fixed?

Original comment by brad.mei...@gmail.com on 21 Dec 2011 at 10:30

GoogleCodeExporter commented 9 years ago
Same problems here.
Anyone who knows the solution?

Original comment by peter.va...@gmail.com on 28 Feb 2012 at 8:52

GoogleCodeExporter commented 9 years ago
Same prob here.. maybe a new thread needs to be started?

Original comment by Cherokee...@gmail.com on 5 Mar 2012 at 8:20

GoogleCodeExporter commented 9 years ago
Using version 1.1.2 - got Temporarily Moved message. Changed calendar to Public 
- that fixed it for Firefox, Chrome and Safari, but IE9 (Grrrrr!) just shows 
events in the current month and the one thereafter but none of the events 
thereafter.

What is different in the behaviour of IE9 that it won't pull in the rest of the 
data in the calendar?

Original comment by i...@voxharmony.org.au on 20 Jun 2012 at 6:31

GoogleCodeExporter commented 9 years ago
Problem is not fixed moderators!

Original comment by wijzijnz...@gmail.com on 19 Nov 2013 at 4:08

GoogleCodeExporter commented 9 years ago
Its down again Temporarily Moved & Permenetly Moved errors

Original comment by qbav...@gmail.com on 28 May 2014 at 7:25

GoogleCodeExporter commented 9 years ago
I confirm:
it's down again...

Original comment by gae...@gmail.com on 5 Jun 2014 at 7:12

GoogleCodeExporter commented 9 years ago
Yes, down for me to, also on the restylegc official website...

Original comment by stages.p...@gmail.com on 5 Jun 2014 at 1:15