Can we use wxWidget to save a webpage onto the disk - html

I was using wget with system call (c++) to save a webpage from internet to my HD in a program. Now I want to use wxWidget to do the same. Is there anyway I can do that and still have the generic behaviour of wget? (i.e. i give a link to a pdf file n then a pdf file is saved)
I found this link http://wiki.wxwidgets.org/Download_a_file_from_internet
but I have no idea how to convert wxString to a pdf/mp3 file according to the url entered.
Could anyone help please. I am working on an open source project for the first time and I encountered this wxWidget just now

If you are happy using wget with a system call, then why not continue to do so?
wxWidgets is a GUI framework, with a lot of extra convenience functions included. You don't HAVE to use them. You can still use whatever C++ features, utilities and packages that your are familiar with.
Here is a link to Wget for Windows

You can use wxHTTP (as described here) or use wxURL and GetInputStream()

Related

Can I run the Go compiler in the browser?

I recently found out that Go compiles down to WebAssembly. Cool!
As per this Go doc, the Go toolchain itself is written in Go.
This made me think, can the Go compiler run in the browser? Can I make a website which given a file path through an upload button (though, without uploading anything), can compile a Go project and return the executable as a "download"?
The end result I'm looking for is an executable file saved to disk, not for the Go code to run in a browser, but I don't need the exact scenario above to be followed as long as that is the final result.
If this is possible, what are the limitations, if any?
Additional resources I have looked at:
A compiler from Go to WASM on GitHub
Someone working on a game where entered Go code runs in the browser
EDIT: I have started work on this, based on a similar project. The repo can be found here: https://github.com/TR-SLimey/IBGC
It is possible, but it's hard to do.
You can't access files using WebAssembly. Instead, you need the user to drop a folder inside the webpage and use the File and Directory Entries API to get the files and their contents.
But the real problem is passing the files from JS to WASM and vice-versa. You'll also need to replace in the compiler source code all the calls to the Go standard library that would access files to calls to JS functions. Those function need to access the WASM memory directly. You will need to modify the compiler quite a bit.
To download the binary, you can create a Blob, use URL.createObjectURL() to get an URL to that blob, create an <a> element with .download = true and .href = <the blob URL>, and then .click() it.
The performance might be worse than running the Go compiler directly, but other than that it should work just fine.

PHP Desktop - Access to local resources

can you help me with access to local reseources?
For example I want glob my images outside of www folder. PHP has access but chrome not show this images.
Thanks for your answer.
Martin
Browser cannot access anything outside of the www/ directory, but PHP scripts can access the whole file system. You can output images through a PHP script, see for an example:
Output an Image in PHP
What you're trying to achieve is possible with PHP Desktop and it is quite easy. In PHP Desktop you have full access to the filesystem in PHP scripts and you can replace the native "Choose file" dialog with your own custom implementation using PHP and js/jquery scripting. You could reuse or base your code on some existing PHP library that allows you to browse files,
see https://tinyfilemanager.github.io/demo/.
Or just do something simple, I think implementing a custom "Choose file" dialog with jquery and PHP is a matter of a few hours.

How to open a heavy html file

I have recently downloaded my facebook archive, which is a very old account I started in 2009.
There is some conversations I would like to read, the main problem is that messages.html inside the zip weights 98 mo.
Unfortunately,neither mozilla or google chrome can open those 21109 lines of codes in a webview without crashing.
I could open the document with Notepad++, but it's just like searching for a needle in a haystack.
Could you help me please ?
Further to the LINUX comments, we can only assume you are trying to look (or search) inside the html file. You can use any good, text editor like: TextPad, EditPad, etc. You can also download "Unxutils" (not it is not mis-spelled) and use the Windows ports of grep/sed/awk/head/tail/cut etc. There maybe comments or answers posted to use Cygwin which work fine, but require the use of DLL libraries and such. The UnxUtils are stand-alone exe files are work right out of the box with no installation required.
If you are interested in getting some readable files for each conversation you can use the first part of this tutorial which generates csv files which are easily searchable.
http://openmachin.es/blog/facebook-messages

compiling HTML5 to .exe/.dmg

I am currently beginning a project where we want to build an Interactive Whiteboard (educational activities) and deploy via CD-ROM. I want to build the project in HTML5 for it's interactivity and then somehow compile it to both .exe. and .dmg so when the CD-ROM is inserted it autoplays the 'Game'.
How is this possible? Any help/advice would be greatly appreciated. Thank you.
I already made a project using pure C (WinAPI) on github that can pack HTML files into single EXE using resources.
http://github.com/dns/WinAPI-Embed-Browser/releases
Use: res://programname.exe/test.html as path to access html files from your EXE file.
From here you also can hide the window border & just showing the content of your HTML app, or even running on fullscreen. This is very useful if you want to make interactive CD-ROM.
On Mac, you can use Delphi/Lazarus TWebBrowser control to load html files. However I don't know if mac program can access files from resource or not.
HTML 5 is a browser technology, so I think as long as the pc you are installing on has the latest browsers, installing your app should work fine.
Can you tell us why you want it as a CD-ROM based installation, where as you can easily host it online?
You may not need any .exe wrapping. Here is an approach.
Important: your autorun will be often disabled, [not so] quietly. Provide some instructions for running your application manually.
So:
Google for running a portable version of Firefox or Chrome from a CD. Have the browser prepared. Put it in a [sub]directory representing your CD.
Put your content there.
Create a .cmd file to invoke the browser with a command like,
FirefoxPortable.exe index.html
Create autorun.inf (details googlable) to call the above batch file.
Make a CD image from that directory. There are lots of CD burning applications that can do that.
Test.

How to create HTML5 100% offline applications?

Sometimes I need to write a small program just to represent some data in a chart, or similar stuff. I have been wanting to do this kind of things through the browser, with HTML5. I think it would be nice to use its canvas to create a nice UI for simple apps.
I have read some articles related to offline applications with HTML5, but they focus on downloading all the data you need and save it to the cache to use it offline later. You even need to set up an Apache server (or similar) to create your app.
I don't need my app to be online, just in my computer. I just want to create a simple application, nothing to do with internet at all.
How can I do this? Is it even possible or worthy? Is there any "Hello world!" tutorial about this around there?
Something like Mozilla Prism would be good for displaying the content as an application.
There's no need to have a web server like Apache for just displaying HTML5/Javascript in a browser. You can just have it all in a folder on your desktop and then load it in the browser with the file:// protocol.
For example file://C:/Documents and Settings/YourUser/Desktop/YourApp/index.html would open an HTML file in a folder called YourApp on your user's desktop.
If you ever find you need to read static HTML+Javascript files locally then I'd recommend using this python command in the console:
python -m SimpleHTTPServer
It launches a simple HTTP server (who'd of guessed) that serves files from the current working directory. Effectively, it's the same as launching an apache webserver, putting some static assets in /var/www/... etc. etc.
You could also just browse to the assets at file:///some/folder; however, most browsers will prevent javascript from using AJAX when files are loaded in that way, which will manifest as a bunch of bugs when you go to load it.