Alternative url to my Pythonanywhere website? - pythonanywhere

The normal url to my website is :
http://<username>.pythonanywhere.com
Is there a way to to access the site using the IP address of the pythonanywhere server, something like :
http://50.19.109.98/~<username>

You can. You can hit http://50.19.109.98 and set the host header to <username>.pythonanywhere.com. Otherwise the webserver (that serves a large number of sites) has no idea which site you're trying to access.

Related

List of Facebook CDN addresses

I need to compile a list of the addresses of all the CDNs used by Facebook.
Example:
fbcdn-sphotos-a.akamaihd.net
fbstatic-a.akamaihd.net
...
I need these for a captive portal application that allows user to connect to WiFi with facebook. We allow facebook.com through the firewall for Graph API calls, but one of the issues we had is that the Facebook login dialog takes forever to load and loads without stylesheets/images. We fixed that by white-listing fbstatic-a.akamaihd.net, but we want to make sure we won't have surprises later.
fbstatic-a.akamaihd.net
fbcdn-profile-a.akamaihd.net
fbcdn-sphotos-a-a.akamaihd.net
fbcdn-creative-a.akamaihd.net
fbexternal-a.akamaihd.net
And:
fbcdn-sphotos-b-a.akamaihd.net
fbcdn-sphotos-c-a.akamaihd.net
fbcdn-sphotos-d-a.akamaihd.net
fbcdn-sphotos-e-a.akamaihd.net
fbcdn-sphotos-f-a.akamaihd.net
fbcdn-sphotos-g-a.akamaihd.net
fbcdn-sphotos-h-a.akamaihd.net
Those start from character A and ends at H, if Facebook would add a new domain it must be like :
fbcdn-sphotos-i-a.akamaihd.net
So future CDN domains would be
fbcdn-sphotos-j-a.akamaihd.net
fbcdn-sphotos-k-a.akamaihd.net
fbcdn-sphotos-l-a.akamaihd.net
fbcdn-sphotos-m-a.akamaihd.net
fbcdn-sphotos-n-a.akamaihd.net
And So on.. till character Z
akamaihd is used for old photos and for special photos(cover ph. example..) only as I see...
They created new servers and there is some new logic in them as well. Example:
scontent-a-lhr.xx.fbcdn.net
scontent-b-lhr.xx.fbcdn.net and more but I have seen some shared photos on interesting links. Example this:
https://fbcdn-sphotos-h-a.akamaihd.net/hphotos-ak-prn2/v/1472407_10151814939401656_1687041676_n.jpg?oh=d92bc9af7f987c5fe298ecc8c717a4e1&oe=5287894B&__gda__=1384659513_abeb3f33223e6e737aff91419149509e

Redirect a.com/suffix to b.com

Context: I'm developing a website for a conference happening early next year. I'm using tito.io to process registrations and Github Pages to host the website.
At the moment, users register by visiting https://tito.io/maine-civic-hack-day/maine-civic-hack-day-2013. I'd like to clean that up, and point them to http://mainecivichackday.com/register instead.
I've read about 301, 302, and masked redirects, but as far as I've seen so far, those are applicable to subdomains. For instance, I can make this work with register.mainecivichackday.com, but not with mainecivichackday.com/register.
What are my options?
TLDR: how do I point a.com/b to c.com?
You can set up a redirect on the a.com/b page to b.com/a but the user will see that they were redirected to.
If you want it to show as a clean url to the user, the webserver at tito.io will have to be configured to answer to your desired url such as http://register.mainecivichackday.com

Cant change Secure Canvas URL

Simply trying to change the Secure Canvas URL to the SSL one provided by hostgator hatchling account (as described at: "http://support.hostgator.com/articles/ssl-certificates/ssl-setup-use/how-to-make-your-facebook-app-ssl-secure") however when tryin to change the Secure Canvas URL the following erroro happens:
Error
There was a problem saving your changes. Please try again later.
Word on the web is that FB blocked Hostgator public ssls so if this is the case are there any redirect tricks or something before simmply changing domain or getting one of those personal SSL certs... thanks
Copied this from the first comment in the thread on this page: https://developers.facebook.com/bugs/470696239634134/ . It worked for me!
for hostgator shared SSL you have to add the port 443. example: "https://secure123.hostgator.com:443/~username/"

Facebook app oauth dialog error

I've been searching for the answer for days and I haven't been successful so I finally post to ask.
I'm developing a facebook app locally (it says I can develop locally in the guide) and having an issue when trying to authorize the app.
The following is the error msg I get when I direct to http://www.facebook.com/dialog/oauth?client_id=MY_APP_ID&redirect_uri=https://apps.facebook.com/MY_APP_NAME
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Error
An error occurred with Footmarker. Please try again later.
API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: Invalid redirect_uri: Given URL is not allowed by the Application configuration.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Canvas URL & Site URL : http://localhost:8888/app/
I'm using EasyPHP hence port 8888. I tried changing port number to 80(default), 8080(one used in facebook guide) and no success.
I don't know if it's EasyPHP that causes the problem or simply I'm doing something wrong.
This thing drives me crazy. Help much appreciated. Thanks.
in this url: http://www.facebook.com/dialog/oauth?client_id=MY_APP_ID&redirect_uri=https://apps.facebook.com/MY_APP_NAME
You have to set redirect_uri=http://localhost:8888/app and authorize the localhost domain in your facebook app's settings (in the App domains field).
The Site URL & Canvas URL are used to check if the redirect_uri is not set to another URL for security reasons but the standard specify redirect_uri so they've let this parameter.
It's for this kind of error I built OAuth.io. We don't want more developers like you with a headache using OAuth.
using it is really easy:
OAuth.popup('facebook', function(err, res) {
// here, you can use res.access_token to make your API Call
// or...
res.get('/me')
.done(function(data) {
alert('Hello ' + data.name)
})
})
With this, you can't make mistake with URL anymore :)
The problem here is that your URL is not on the Internet. It is accessible from your computer only. You need a public URL.
Perhaps you can use dynDNS free to get onto the Net with your application from home.
Or, get a web server connected to the Net to host your App.
Best of luck!
this just because of URL mistake
whatever website url is specified should be correct.
i mentioned website url as http://localhost:3000/ and domain as localhost
but in my browser i was running http://0.0.0.0:3000/ that was the actual problem so i ran server as localhost:3000 now its working fine. Because we mentioned site url as localhost fb will redirect to same, if we r running 0.0.0.0:3000 it will rise error that Given URL is not allowed by the Application configuration.
so becarefull with your website url you have specified in facebook app.
and the url you are running locally both should match
thank you

How to handle file uploads to a dedicated image server?

I got a webserver with a running application. There's a webpage with a form: some text data and a file upload field. Now, what I would like to have is it working like this:
The file is sent to the dedicated server, diffrent then the one application is running on. The server should return some kind of path (or anything that identifies the uploaded and saved file and allows to create an URL). Then, both this path and user-filled data should be submitted to the webserver with application, for any kind of database storage.
Problem is, there are 2 diffrent servers, so I can't upload the file with javascript, can I? Another way would be just to use iframe and put the upload form in there - but then I think I can't access the result of the upload (still inside the iframe) with javascript to pass the file path to my main server.
I could also just upload the file to same server my application is running on and then just rsync it to the other one - but I'd like to avoid it if I can, trying to minimalize the traffic actually :)
How do you handle such thing in your applications?
If you used an iframe, you could submit the upload form to the dedicated image server, and in the case of a successful result, have it in turn load a page from the original server with the info (eg. image path) "passed along" as a GET parameter.
POST to dedicated server, server stores image and calls back to web server through a web service or other to give it any info required.