Running one web page across devices with the same data - javascript

I want to make a simple todo list web page for myself so that I can be a more organized person but I have a problem. I want to be able to close the website or switch to another computer and still keep the data of what I have done or not done on this to do list. I have tried to search up ways that I could do this online but I don't know what to search to find the right results.
I know about js and web design stuff but I don't know any back end stuff so.

One way to do this is to upload your code to Github, which is a code management application for developers. Try searching on youtube how to navigate through GitHub and how to upload your code because im not that good with explanations just yet since im a beginner. Once your code has been uploaded, you can simply log into GitHub with the other device and open your code in a code base.

You need to have some kind of backend for what you are planing to accomplish. Such a backend could be a database storing each of your to-dos on a single database row, or some sort of file, which is located on a central server (the file could for example be a .json, .xml or .csv).
However, you can also write a JavaScript app, that stores your to-dos in your local browser storage, but then you would have to implement an export, import logic for a manual sync.
I assume that is not what you are looking for, so I would suggest checking out some services like for example the Google Drive API. You can interact with JavaScript with it and store your to-dos in your Google account: https://developers.google.com/drive/api/v3/quickstart/js

Related

How to commit to a github repo from a website (IN BROWSER) using javascript

I have a website that needs a JSON file to display a sort of timetable that's hosted on GitHub pages. People who do not know what javascript or GitHub are need to be able to change that JSON file each week.
To solve this I've created a website that reads data from a google sheet they can edit, and turns it into a js object at the click of a button. I now just need to get this object from the website into the JSON file on the first GitHub repo, but I have no clue how to do this. I know you can use the GitHub API somehow, but how??
P.s. I know making the token built into the website is a security risk which is why I plan to only put tokens in the google sheet, which requires the user to authenticate a google account before being accessed.

how can a profile page be made for a social network in asp.net C#

I am trying to make a simple social network for my school project but I am not really understanding how the profile page works. should I create a different page for every user? (or automatically). And then update it when someone adds or deletes a new photo or status? or should I connect everything with database?
so any other suggestions how this can be done? I prefer to do first more. but still not sure if it can be done.
PS: javascript can be included too if its necessary. also, for pics Im going to use imgur and just implement the link in the image source
Connect everything with a database. Each user should be uniquely identified in the database; then add additional tables to your database that consist of each user's data ... like posts, pictures, likes, etc. Create relationships between all tables based upon each user's unique ID.
Or download free version of Visual Studio Community https://www.visualstudio.com/downloads/ then install FaceBook template.

Javascript apps: Recommended way of storing chat messages on client's end

This is more of an asking for an advice question. I am trying to implement the web version of my mobile chat app. But as HTML,CSS,JS are the main tools in browsers and there is no local database to temporarily store chat messages on client's UI.
Like in the mobile, all of my notifications, messages and everything are stored in tables and I can query the database whenever user opens up the chat activity(Android), find all the messages related to this user and display it inside the app's display.
What can be the best way to store chat messages as JS objects in client's UI and quickly find what's needed?
The JS structure should also be easy to find messages by name,time,status etc.
I am trying to implement something very similar to WhatsApp Web.
I would look into https://github.com/knadh/localStorageDB. But to be honest it's something I wouldn't do because there is always a security concern. Someone may gain access to your computer and steal the chat data or some malware may get into your computer.
It wouldn't be hard to just query the database for all the chat data when the user loads the web-page. Of course you would use pagination instead of just grabbing everything.
Good luck.
jStorage
AND
store.js
are good options.

Is there any function to update your web site when another site post something new?

As example, i want to update my item list every time Amazon add a new product, is possible to do it without knowing their system or DB?
Unfortunately, no!!! This is the disadvantage of relying on a 3rd party site for the content of your site. However, using the API of the site, whose data you want to access, can give this functionality, but this will not work for all the sites.
If the 3rd-party site does not provide an API to access their data, you'll need to "scrape" the site of that data. In theory this is easy, however, large companies like Amazon deliberately attempt to foil scraping attempts. See an open source project dedicated to this exact prupose: https://github.com/adamlwgriffiths/amazon_scraper The author says it best:
Amazon have resorted to moving more and more content into iFrames which this scraper can't handle. I envisage a time where most data will be inaccessible without more complex logic.
I've spent a long time trying to get these scrapers working and it's a never ending battle. I don't have the time to continually keep up the pace with Amazon. If you are interested in improving Amazon Scraper, please let me know (creating an issue is fine). Any help is appreciated.
If you want to build a custom tool to scrape public websites, I would check out Node.js. It is popular due to its ability to query the page DOM effectively. There are some good writeups out there to get started: https://scotch.io/tutorials/scraping-the-web-with-node-js

Is it possible to generate a text or xml file from local storage data and save it in a folder?

I'm working on a website that is going to be offline. All the html files will be in a folder stored on the hard-disc. I've managed to do 90% of the work and the last part I have no idea of. Here is what it is:
I have stored a list of products in the localStorage as various strings under the keys - like buying objects and it goes to the cart, the cart objects are in localStorage. I created a page that showed the list of all the products in the localStorage. It can be cleared if the user clears them. Now I need to create a page where all the objects that was selected before, regardless of the localStorage being cleared, show as list in this page. You can take it as the page that lists products that have been ordered in the past, i.e even after the cart is cleared the products will show in the past-orders page.
I do not know any server side codes, I did everything using JavaScript as it was supposed to be a simple project, but I'm stuck at this part. So I cannot use PHP or anything to generate files or use a database to store stuff.
Here's what I thought but I don't think it works but wanted to confirm if it does or not:
Generate an XML file or a .txt file and store it in the drive and then clear the localStorage. But I don't think it is possible. If its possible just using JavaScript please point me in the right direction and I'll research and come up with something.
P.S. the website will be entirely offline what I mean is the users will never connect to the internet for this to work. Also there won't be a server or localhost.
Thank you!
The site is completely offline, but functionality is similar to an eCommerce site. You click a button and some content from the website stores in the localStorage and I have to call it in multiple pages, when a user clicks another button, localStorage clears but whatever was selected before must be available without localStorage. Hmmmm.. Consider a quiz site where you answer everything and when you take a new quiz, old scores will be stored somewhere else and it won't change when you take a new test.
Is it possible to attain this functionality without a server side script? It seems the final-targeted-users won't know how to install any softwares that can provide a localhost or a server or something like that.
Client-side, browser's JavaScript runtimes don't have local file system access excepting a very limited one when uploading files to a remote server, and anyway, browers won't give you direct access to the file.
You'll need some kind of server-side logic behind the scenes if you want full I/O in the local file system.
Perhaps you can take a look at NodeJS, a server-side JavaScript runtime that can work as lighty Web server on either small and large projects, and it has built-in server-side JavaScript I/O functions.
Otherwise, you're absolutely stuck in the client-side Web browser's sandbox limitations.
U can refer documents of knockoutjs and NodeJS.. That would probablky help... A far as my knowledger is concerned NodeJS does contain a way to handle your problem.

Categories