Push website manually to the WayBackMachine from archive.org - archive

Is there a way to upload or trigger a snapshot of the own website to the WayBackMachine from archive.org? I've checked the FAQ and the archive.org API, but can't find any way to trigger this with a script.

It seems that if you can trigger a call to http://web.archive.org/save/{{URL}} it will unofficially force-save the page. This seems to be a bit of a hack rather than an official approach.

Related

How to add a Docusaurus website within Next.js Website as a route

Does anyone have any pointers on how to go about adding a /docs page for website documentation to a next.js app? I've looked up Docusaurus but it seems like it's already a react app itself. Is there a way to integrate it inside an existing next.js app or are there other solutions?
Many Thanks
One idea might be to intercept the request and send the html file that docusaurus builds out, and putting all other files in the public folder.
https://medium.com/wesionary-team/render-html-file-in-pages-of-next-js-59281c46c05
Also checkout this discussion about it.
https://github.com/vercel/next.js/discussions/12373
I have done this with React apps using express. But never with Next. At first it looks like it would be possible with multi-zone in Next but that doesn't seem to do the job. So my other recommendation would be to try to use a docs.domain.com instead and host it separately. Then you have a /docs url or a button that redirects to the doc domain instead.
Firebase has free hosting and allows you to setup multiple sites. So it should be fast to test this setup there
I'm going to actively try to get this to work with Next myself but I do not think it will work because of how they are developed. So I would do the above recommendation and if I find a workaround, I'll post an update.

httpbin.org/get request keep on called in Reacts application

Can any one explain why a get request kept on called in Reacts application. Refer the below image.
I found out the solution, I was using a npm package "react-detect-offline" to render components based on online and offline status, that was triggering a request to check the same.
if possible could you please expand upon your question a little more, like maybe an example of your code that's making the request?
(I don't have enough rep to post comments)

Question on react and express website and updating them

I have been trying to figure out how to learn making a website.
Does all blog or a any news website have to be a cms. Then wouldn't all pages be the same. If not how does one update their website when adding new posts. Can I do it only from database?
It seems if its made only on html and css updating it would involve adding new new html page every time?
For example this website, how do they add new articles?
Would you recommend making a blog on react?
Thanks very much?
Does all blog or a any news website have to be a cms.
I will say, yes and no,
You can dynamically add new html page whenever you have new posts, or blog, then you create a new route for each request. It works fine,(and a lot simpler, and less worry about other stuff, learn from there and then you get a taste of how it works, I will always suggest you to go with something easier, start really small, since you are starting to learn) until you have to post a lot of post, which will be troublesome to update the server code each time.
Where you have to do as follow: Update codebase (new route: /get/my-new-blog-123), then deploy your server code whenever you have a new post to the cloud server, eg: google cloud platform, heroku, etc. Which is a lot of work.
Till then, which comes to what you have mentioned, Content Management System, where most blog post is structure properly, such as how to insert a picture, text style, typography, etc. Then this html structure will store in database, the route will likely be /get-post/?article-name
article-name will be something u can query from database, then your life will be a lot easier with this.
Would you recommend making a blog on react?
Yes, definitely, It is easy to learn, but try not to overwhelm yourself with so many tools, such as formik(form submission), redux(state management), whenever you learn something from a blog, most time you will see this. Which will be quite overwhelming, when you are learning so many stuff at once. Especially, if you are really new to HTML, CSS and javascript.
Start small, learn fast, then grow. All the best to you.
It’s like when you fill out a form
When you press send or save
It’ll go into the backend which means it’s in the database
And from the back end it’ll render to the front which is the website
I can try to elaborate it more if you want.
And you can make a blog using any framework you are comfortable with
Or you can just use plain ol HTML Css and JavaScript.
I think it’s best to start at this before moving to a framework

Is there a way a method can be triggered or run during a salesforce package installation process?

I would want to do this to run post installation setup process like adding custom data that is required for the application to run.
One option I am aware of is to Write Installation and Setup instructions for users. Create visualforce page and include a button on this page. Redirect user to this page as the process of Installation and ask the user to click the button.
I only wanted to know If there was a more elegant way to solve the problem and if there is a way to call a method during the installation process.
Salesforce has recently implemented the ability to execute scripts (as Apex) during package Install / Uninstall:
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_install_handler.htm
No, we can't have a post installation script for the app. What you are saying is best solution, just keep a custom setting to flag, if initial setup is not done, then redirect to the setup page first, other wise do the normal work.
My question would be revolving around why you need custom data for the app to run? One of the things Salesforce look for when doing a security review of your code and the unit tests you have is to check to see if you are requiring data in your org as this is bad practice. Note that if your app is requiring specific data to run then it cannot be tested properly as the data will not be in the org when running the tests on install.
What is the data you are requiring? Could it be stored in an xml like static resource file or something similar for you to load and parse as it is needed?
Paul

FB.getLoginStatus never fires the callback function in Facebook's JavaScript SDK

The simple thing of calling FB.init (right before </body>) and then FB.getLoginStatus(callback) doesn't fire the callback function.
After some debugging, I think the SDK is stuck in the "loading" (i.e. FB.Auth._loadState == 'loading') phase and never gets to "loaded", so all callbacks are queued until the SDK has loaded.
If I force-fire the "loaded" event during debugging - with FB.Event.fire('FB.loginStatus', 'loaded') in case you're intersted - then the callbacks are invoked correctly.
Extra details that might be relevant:
My app is a facebook iframe app (loaded via apps.facebook.com/myapp)
I'm using IE9. The same behavior happens in Chrome
The app is hosted in http://localhost
What's going on? Why is the SDK never gets to loaded?
Thanks
UPDATE: Just tried it on Chrome and it worked (not sure why it didn't work before). Still doesn't work in IE
I had this same problem in Firefox 3.5 on Windows, but only on the very first log in to the page (probably because it was a slower machine and there was some weird timing issues going on).
I fixed it by forcing FB to refresh the login status cookie every time it checks:
FB.getLoginStatus(callback, true); //second argument forces a refresh from Facebook's server.
Without "force=true", sometimes it wouldn't fire the callback.
I had the exact same problem, and I solved it disabling "Secure Browsing" in the Facebook Security settings. Keeping Secure Browsing on forces the pages as "https", but I had no "Secure Canvas URL" set up, and this gave me a lot of errors in the console as well.
Hope this may help someone :)
In my experience, getLoginStatus() never calls the callback in Firefox when third-party cookies are disabled.
The original poster mentioned his application is hosted on http://localhost. I've never had luck with that, and believe it will cause problems.
Just today, I've had problems where getLoginStatus is not calling the callback on any browser, unless the user is actually connected to the app! I'm hoping this is a bug on facebook's end that they will solve.
Yet another possibility for FB.getLoginStatus not firing its callback is when using a "test" user account that has not been authorized to view that application. Its pretty bad that facebook doesn't give you any error messages.
I have also seen failed callbacks on bad appIds and redirectUrls.
I also ran into this issue specifically in Chrome. I tried calling it on page load and after a user-initiated action with no success.
It turned out that it was not a cross-domain issue. The getLoginStatus() call was being blocked by the Un-Passwordise extension in Chrome. As soon as I disabled the extension, it worked perfectly, even on page load.
More info about this issue here: Chrome-only cross-domain scripting errs in Facebook iFrame App upon FB.Login(..)
I understand that this question is a little old now, but I ran across it searching for solutions.
Double-check what you have set in your Facebook app configuration under the section "Website with Facebook Login". The Site URL domain must match the domain your page with the FB.getLoginStatus (and other related auth Javascript) is served from.
After hours of struggling, I realized that I could not reuse an existing app configuration I had on a new server and had to create a new app to handle the website login for this new server.
The other answers are probably equally valid in your specific case, but since there may be others like me who have struggled for a while on this, hopefully this gives you one other place to check. Making a new app with the correct Site URL was the answer in my particular case.

Resources