Converting XML to JSON (new tease)

All about the past, current and future webteases and the art of webteasing in general.
---
RemiHiyama
Explorer At Heart
Explorer At Heart
Posts: 203
Joined: Thu Feb 28, 2019 3:30 pm
I am a: Switch

Re: Converting XML to JSON (new tease)

Post by RemiHiyama »

PlayfulGuy wrote: Wed Apr 07, 2021 2:19 amYeah, from what I've seen the images are a bigger hurdle. From my limited experience with EOS the image names are basically all sequential numbers. Like you upload the image, EOS assigns it a number, and then you link the image to a page in your tease (or vice versa).
That's only for images that are in a gallery. If they're in "files", the name is in there and gets used in locators. So in theory you could just upload the images to the files section of a new EOS tease, then download the .json, and it'd contain everything you'd need, then do the rest of the conversion process from there.

... At least if the setup doesn't depend on subdirectories for organization. I'm not sure of a good way to handle things in that case.
Auto: Replaces selected instances of the word "not" with the word "definitely".
JBK
Explorer At Heart
Explorer At Heart
Posts: 156
Joined: Sun Feb 14, 2021 6:57 pm
Gender: Male
Sexual Orientation: Straight
I am a: Switch

Re: Converting XML to JSON (new tease)

Post by JBK »

PlayfulGuy wrote: Wed Apr 07, 2021 2:18 am
How much javascript do you use in your tease? The biggest challenge I have had converting EOS to Guideme is converting javascript to work. The two platforms have different interfaces and libraries available and some need for translation is inevitable.

Though EOS is a better environment in some ways, so it may actually be easier to translate from Guideme to EOS.

PG
The main use of Javascript in the tease in playing ogg-files at a certain volume. I'm also using it to change the text while on the same page and to block/unblock buttons (but I could do that in basic XML to by jumping to the next page when the buttons need to become available). In the future, I'd like to use Javascript for basic global variable stuff as well (like load a difficulty setting for the tease, or load the volume related to the difficulty setting).

This is an example of the most complex Javascript I'm using right now:

Code: Select all

      <Text>Silence? I'm guessing you don't like it here then.</Text>
      <Image id="others/AbigailMac1/AbigailMac1-11.jpg"/>
      <Delay seconds="22" style="hidden" target="enc203-05"/>
		<javascript>
			<![CDATA[
				function pageLoad() {
					overRide.setAudio("_audio/104a.ogg","","","","","","","",70);
					overRide.addTimer("6", "", "", "That's a shame, but maybe I can help you!", "", "", "");
					overRide.addTimer("12", "", "", "Would you like me to help you?", "", "", "");
					overRide.addTimer("13", "enablebuttons()", "", "", "", "", "");
					overRide.addButton("enc203-05a", "No thanks!", "", "", "", "", "", "", true, "Btn203e");
					overRide.addButton("enc203-05b", "Yes, please!", "", "", "", "", "", "", true, "Btn203f");
				}
				function enablebuttons() {
					guide.enableButton("Btn203e");
					guide.enableButton("Btn203f");
			}]]>
		</javascript>
    </Page>
And also this:

Code: Select all

		<javascript>
			<![CDATA[
				function pageLoad() {
					overRide.setAudio("_audio/103a.ogg","","","","","","","",70);
					if (guide.isSet("2301") || guide.isSet("2302")) {
						overRide.addTimer("6", "", "others/AbigailMac1/AbigailMac1-12.jpg", "It is clear to me that your mind is in need of some minor corrections.", "", "", "");
						overRide.addTimer("12", "", "", "Let's start right away.", "", "", "");
						overRide.setDelay("enc203-07", "18", "", "", "", "", "");
					}
					else {
						overRide.addTimer("6", "", "", "You seem to be in good mental health!", "", "", "");
						overRide.addTimer("12", "", "", "I'll be slowly taking off the rest of my clothes and sending you relaxing waves. Enjoy!", "", "", "");
						overRide.setDelay("enc203-06", "18", "", "", "", "", "");
					}
			}]]>
		</javascript>
Hopefully this is not to complex :)
Thamrill
Explorer At Heart
Explorer At Heart
Posts: 301
Joined: Thu Jan 03, 2013 4:55 pm
Gender: Male
Sexual Orientation: Straight
I am a: Submissive

Re: Converting XML to JSON (new tease)

Post by Thamrill »

RemiHiyama wrote: Wed Apr 07, 2021 4:33 am
PlayfulGuy wrote: Wed Apr 07, 2021 2:19 amYeah, from what I've seen the images are a bigger hurdle. From my limited experience with EOS the image names are basically all sequential numbers. Like you upload the image, EOS assigns it a number, and then you link the image to a page in your tease (or vice versa).
That's only for images that are in a gallery. If they're in "files", the name is in there and gets used in locators. So in theory you could just upload the images to the files section of a new EOS tease, then download the .json, and it'd contain everything you'd need, then do the rest of the conversion process from there.

... At least if the setup doesn't depend on subdirectories for organization. I'm not sure of a good way to handle things in that case.
If they are in files it's not needed to upload image and then download the JSON, the portion dealing with files can be defined directly in the process of converting the guide me script, as the name the files are going to have in the milovana system is their md-5 hash, if I remember correctly. The process you suggest could be used for galleries, to generate the file-number pair and then convert in the script the image locators to the desired gallery identifier
Image

Image

Image
User avatar
PlayfulGuy
Experimentor
Experimentor
Posts: 1068
Joined: Sat Jul 07, 2012 10:08 pm
Gender: Male
Sexual Orientation: Bisexual/Bi-Curious
I am a: Switch
Dom/me(s): No domme
Sub/Slave(s): No sub
Location: British Columbia, Canada

Re: Converting XML to JSON (new tease)

Post by PlayfulGuy »

JBK wrote: Wed Apr 07, 2021 6:32 am
The main use of Javascript in the tease in playing ogg-files at a certain volume. I'm also using it to change the text while on the same page and to block/unblock buttons (but I could do that in basic XML to by jumping to the next page when the buttons need to become available). In the future, I'd like to use Javascript for basic global variable stuff as well (like load a difficulty setting for the tease, or load the volume related to the difficulty setting).

This is an example of the most complex Javascript I'm using right now:

Code: Select all

      <Text>Silence? I'm guessing you don't like it here then.</Text>
      <Image id="others/AbigailMac1/AbigailMac1-11.jpg"/>
      <Delay seconds="22" style="hidden" target="enc203-05"/>
		<javascript>
			<![CDATA[
				function pageLoad() {
					overRide.setAudio("_audio/104a.ogg","","","","","","","",70);
					overRide.addTimer("6", "", "", "That's a shame, but maybe I can help you!", "", "", "");
					overRide.addTimer("12", "", "", "Would you like me to help you?", "", "", "");
					overRide.addTimer("13", "enablebuttons()", "", "", "", "", "");
					overRide.addButton("enc203-05a", "No thanks!", "", "", "", "", "", "", true, "Btn203e");
					overRide.addButton("enc203-05b", "Yes, please!", "", "", "", "", "", "", true, "Btn203f");
				}
				function enablebuttons() {
					guide.enableButton("Btn203e");
					guide.enableButton("Btn203f");
			}]]>
		</javascript>
    </Page>
And also this:

Code: Select all

		<javascript>
			<![CDATA[
				function pageLoad() {
					overRide.setAudio("_audio/103a.ogg","","","","","","","",70);
					if (guide.isSet("2301") || guide.isSet("2302")) {
						overRide.addTimer("6", "", "others/AbigailMac1/AbigailMac1-12.jpg", "It is clear to me that your mind is in need of some minor corrections.", "", "", "");
						overRide.addTimer("12", "", "", "Let's start right away.", "", "", "");
						overRide.setDelay("enc203-07", "18", "", "", "", "", "");
					}
					else {
						overRide.addTimer("6", "", "", "You seem to be in good mental health!", "", "", "");
						overRide.addTimer("12", "", "", "I'll be slowly taking off the rest of my clothes and sending you relaxing waves. Enjoy!", "", "", "");
						overRide.setDelay("enc203-06", "18", "", "", "", "", "");
					}
			}]]>
		</javascript>
Hopefully this is not to complex :)
No, that's good. Most of that has direct equivalents in EOS so it's a fairly simple translation.
User avatar
PlayfulGuy
Experimentor
Experimentor
Posts: 1068
Joined: Sat Jul 07, 2012 10:08 pm
Gender: Male
Sexual Orientation: Bisexual/Bi-Curious
I am a: Switch
Dom/me(s): No domme
Sub/Slave(s): No sub
Location: British Columbia, Canada

Re: Converting XML to JSON (new tease)

Post by PlayfulGuy »

RemiHiyama wrote: Wed Apr 07, 2021 4:33 am
PlayfulGuy wrote: Wed Apr 07, 2021 2:19 amYeah, from what I've seen the images are a bigger hurdle. From my limited experience with EOS the image names are basically all sequential numbers. Like you upload the image, EOS assigns it a number, and then you link the image to a page in your tease (or vice versa).
That's only for images that are in a gallery. If they're in "files", the name is in there and gets used in locators. So in theory you could just upload the images to the files section of a new EOS tease, then download the .json, and it'd contain everything you'd need, then do the rest of the conversion process from there.

... At least if the setup doesn't depend on subdirectories for organization. I'm not sure of a good way to handle things in that case.
Ah, yes I'd forgotten that! Most of the teases I've been using as test cases the last couple months make extensive use of galleries, so you're right, with a little planning it should be doable.

PG
JBK
Explorer At Heart
Explorer At Heart
Posts: 156
Joined: Sun Feb 14, 2021 6:57 pm
Gender: Male
Sexual Orientation: Straight
I am a: Switch

Re: Converting XML to JSON (new tease)

Post by JBK »

PlayfulGuy wrote: Thu Apr 08, 2021 8:10 pm No, that's good. Most of that has direct equivalents in EOS so it's a fairly simple translation.
Is there a guide on how to translate XML to webtease-EOS?
User avatar
PlayfulGuy
Experimentor
Experimentor
Posts: 1068
Joined: Sat Jul 07, 2012 10:08 pm
Gender: Male
Sexual Orientation: Bisexual/Bi-Curious
I am a: Switch
Dom/me(s): No domme
Sub/Slave(s): No sub
Location: British Columbia, Canada

Re: Converting XML to JSON (new tease)

Post by PlayfulGuy »

JBK wrote: Sat Apr 10, 2021 2:35 pm
PlayfulGuy wrote: Thu Apr 08, 2021 8:10 pm No, that's good. Most of that has direct equivalents in EOS so it's a fairly simple translation.
Is there a guide on how to translate XML to webtease-EOS?
Not that I'm aware of. I just know Guideme really well and have learned enough EOS to know which things have equivalents and which don't.
User avatar
PlayfulGuy
Experimentor
Experimentor
Posts: 1068
Joined: Sat Jul 07, 2012 10:08 pm
Gender: Male
Sexual Orientation: Bisexual/Bi-Curious
I am a: Switch
Dom/me(s): No domme
Sub/Slave(s): No sub
Location: British Columbia, Canada

Re: Converting XML to JSON (new tease)

Post by PlayfulGuy »

Thamrill wrote: Wed Apr 07, 2021 7:39 am
If they are in files it's not needed to upload image and then download the JSON, the portion dealing with files can be defined directly in the process of converting the guide me script, as the name the files are going to have in the milovana system is their md-5 hash, if I remember correctly. The process you suggest could be used for galleries, to generate the file-number pair and then convert in the script the image locators to the desired gallery identifier
Would that be the md5 hash of the file, or just a hash of the file name?
I'm curious to test this out and see what can be accomplished.

PG
Thamrill
Explorer At Heart
Explorer At Heart
Posts: 301
Joined: Thu Jan 03, 2013 4:55 pm
Gender: Male
Sexual Orientation: Straight
I am a: Submissive

Re: Converting XML to JSON (new tease)

Post by Thamrill »

PlayfulGuy wrote: Sat Apr 17, 2021 3:24 pm
Thamrill wrote: Wed Apr 07, 2021 7:39 am
If they are in files it's not needed to upload image and then download the JSON, the portion dealing with files can be defined directly in the process of converting the guide me script, as the name the files are going to have in the milovana system is their md-5 hash, if I remember correctly. The process you suggest could be used for galleries, to generate the file-number pair and then convert in the script the image locators to the desired gallery identifier
Would that be the md5 hash of the file, or just a hash of the file name?
I'm curious to test this out and see what can be accomplished.

PG
I did a test, sorry, wrong algorithm, it's SHA-1 hash of the file, see attached image (I used this picture https://media.milovana.com/timg/48eee62 ... 85f1db.jpg)

Thamrill
Attachments
hash.png
hash.png (45.97 KiB) Viewed 1109 times
Image

Image

Image
User avatar
PlayfulGuy
Experimentor
Experimentor
Posts: 1068
Joined: Sat Jul 07, 2012 10:08 pm
Gender: Male
Sexual Orientation: Bisexual/Bi-Curious
I am a: Switch
Dom/me(s): No domme
Sub/Slave(s): No sub
Location: British Columbia, Canada

Re: Converting XML to JSON (new tease)

Post by PlayfulGuy »

Thamrill wrote: Sat Apr 17, 2021 6:17 pm
PlayfulGuy wrote: Sat Apr 17, 2021 3:24 pm
Thamrill wrote: Wed Apr 07, 2021 7:39 am
If they are in files it's not needed to upload image and then download the JSON, the portion dealing with files can be defined directly in the process of converting the guide me script, as the name the files are going to have in the milovana system is their md-5 hash, if I remember correctly. The process you suggest could be used for galleries, to generate the file-number pair and then convert in the script the image locators to the desired gallery identifier
Would that be the md5 hash of the file, or just a hash of the file name?
I'm curious to test this out and see what can be accomplished.

PG
I did a test, sorry, wrong algorithm, it's SHA-1 hash of the file, see attached image (I used this picture https://media.milovana.com/timg/48eee62 ... 85f1db.jpg)

Thamrill
Interesting. It may all be possible, just not easy.

Thanks for this.
Thamrill
Explorer At Heart
Explorer At Heart
Posts: 301
Joined: Thu Jan 03, 2013 4:55 pm
Gender: Male
Sexual Orientation: Straight
I am a: Submissive

Re: Converting XML to JSON (new tease)

Post by Thamrill »

PlayfulGuy wrote: Tue Apr 20, 2021 5:23 pm
Thamrill wrote: Sat Apr 17, 2021 6:17 pm
PlayfulGuy wrote: Sat Apr 17, 2021 3:24 pm

Would that be the md5 hash of the file, or just a hash of the file name?
I'm curious to test this out and see what can be accomplished.

PG
I did a test, sorry, wrong algorithm, it's SHA-1 hash of the file, see attached image (I used this picture https://media.milovana.com/timg/48eee62 ... 85f1db.jpg)

Thamrill
Interesting. It may all be possible, just not easy.

Thanks for this.
No problem :smile:
Image

Image

Image
Post Reply