<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>caskiSPACE</title>
	<atom:link href="https://www.caskispace.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.caskispace.com/</link>
	<description>Tools, tips and tutes</description>
	<lastBuildDate>Mon, 29 Jul 2024 03:42:27 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>

<image>
	<url>https://www.caskispace.com/wp-content/uploads/2019/12/favicon-64.png</url>
	<title>caskiSPACE</title>
	<link>https://www.caskispace.com/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>AWS: Step Functions</title>
		<link>https://www.caskispace.com/aws-step-functions/</link>
					<comments>https://www.caskispace.com/aws-step-functions/#respond</comments>
		
		<dc:creator><![CDATA[saborot]]></dc:creator>
		<pubDate>Wed, 17 May 2023 02:41:35 +0000</pubDate>
				<category><![CDATA[Code Crumbs]]></category>
		<category><![CDATA[AWS]]></category>
		<category><![CDATA[State Machine]]></category>
		<category><![CDATA[Step Functions]]></category>
		<guid isPermaLink="false">https://www.caskispace.com/?p=12725</guid>

					<description><![CDATA[<p>How to Add Your Step Functions Inside Cloud Formation I recently had to create a series of step functions for a project I am working on. The beauty of using step function is you get to work on it visually; from adding of functions, states, inputs and outputs up to real-time running and debugging. It [&#8230;]</p>
<p>The post <a href="https://www.caskispace.com/aws-step-functions/">AWS: Step Functions</a> appeared first on <a href="https://www.caskispace.com">caskiSPACE</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">How to Add Your Step Functions Inside Cloud Formation</h2>



<p class="wp-block-paragraph">I recently had to create a series of step functions for a project I am working on. The beauty of using step function is you get to work on it visually; from adding of functions, states, inputs and outputs up to real-time running and debugging.</p>



<p class="wp-block-paragraph">It is awesome! However, after the wow factor, one thing that came to mind was &#8220;How am I going to get this inside a repository so it can be versioned?&#8221;. Turns out, I can actually add all of it inside a CloudFormation! Meaning in my application, I can create a YAML file, add it in there and it will generate the State Machine which has all of my step functions inside.</p>



<p class="wp-block-paragraph">First I needed a policy so I can perform Step Function actions from within my application. </p>



<div class="wp-block-group has-white-color has-black-background-color has-text-color has-background"><div class="wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained">
<pre class="wp-block-code has-white-color has-text-color has-small-font-size"><code>
  Resources:
    MyAppRole:
      Type: AWS::IAM::Role
      Properties:
        AssumeRolePolicyDocument:
          Version: '2012-10-17'
          Statement:
            - Effect: Allow
              Principal:
                Service:
                  - states.amazonaws.com
              Action:
                - sts:AssumeRole
          - PolicyName: StepFunctions
            PolicyDocument:
              Version: '2012-10-17'
              Statement:
              - Effect: Allow
                Action:
                  - states:*
                Resource: '*'
</code></pre>
</div></div>



<p class="wp-block-paragraph">Then I added the following inside my <em>template.yaml</em> file under <em>Resources</em> section:</p>



<div class="wp-block-group has-pale-cyan-blue-background-color has-background has-small-font-size"><div class="wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained">
<pre class="wp-block-code has-white-color has-black-background-color has-text-color has-background"><code>
  Resources:
    MyStateMachine:
      Type: AWS::StepFunctions::StateMachine
      Properties:
        StateMachineName: MyStateMachineName
        RoleArn: !GetAtt MyAppRole.Arn
        DefinitionString:
          Fn::Sub: |
            {
            ... STEP FUNCTION DEFINITION HERE
            }
</code></pre>
</div></div>
<p>The post <a href="https://www.caskispace.com/aws-step-functions/">AWS: Step Functions</a> appeared first on <a href="https://www.caskispace.com">caskiSPACE</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.caskispace.com/aws-step-functions/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>CHEAPEST WAY to Bring your Car to Cebu from Manila: RoRo Cebu to Manila, Manila to Cebu</title>
		<link>https://www.caskispace.com/cheapest-way-to-bring-your-car-to-cebu-from-manila/</link>
					<comments>https://www.caskispace.com/cheapest-way-to-bring-your-car-to-cebu-from-manila/#comments</comments>
		
		<dc:creator><![CDATA[saborot]]></dc:creator>
		<pubDate>Mon, 01 May 2023 08:23:57 +0000</pubDate>
				<category><![CDATA[Travels]]></category>
		<guid isPermaLink="false">https://www.caskispace.com/?p=12415</guid>

					<description><![CDATA[<p>This guide will give you a know-how to cheaply bring your car to Cebu from Manila. Quick Links: We recently transported a Toyota Fortuner 2012 from Luzon to Cebu using RoRo ships (Roll-on, Roll-off). To make the journey, we traveled to the southern part of Luzon and boarded a RoRo ship to Masbate. From Masbate, [&#8230;]</p>
<p>The post <a href="https://www.caskispace.com/cheapest-way-to-bring-your-car-to-cebu-from-manila/">CHEAPEST WAY to Bring your Car to Cebu from Manila: RoRo Cebu to Manila, Manila to Cebu</a> appeared first on <a href="https://www.caskispace.com">caskiSPACE</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div class="wp-block-image">
<figure class="aligncenter size-full"><img fetchpriority="high" decoding="async" width="640" height="413" src="https://www.caskispace.com/wp-content/uploads/2023/05/cokaliong.jpg" alt="Car Transport: Cokaliong RoRo Ship" class="wp-image-12471" srcset="https://www.caskispace.com/wp-content/uploads/2023/05/cokaliong.jpg 640w, https://www.caskispace.com/wp-content/uploads/2023/05/cokaliong-300x194.jpg 300w" sizes="(max-width: 640px) 100vw, 640px" /><figcaption class="wp-element-caption">Cokaliong RoRo<em>(Roll-on, Roll-off)</em> Ship</figcaption></figure>
</div>


<p class="has-medium-font-size wp-block-paragraph">This guide will give you a know-how to <strong>cheaply</strong> <strong>bring your car</strong> to <strong>Cebu from Manila</strong>.</p>



<p class="has-medium-font-size wp-block-paragraph"><strong>Quick Links:</strong></p>



<ul class="wp-block-list">
<li><strong><a href="#drive-to-pio-duran">Drive to Pio Duran Port in southern part of Luzon</a></strong></li>



<li><strong><a href="#sail-pio-duran-to-masbate">Sail from Pio Duran Port to Masbate Port</a></strong></li>



<li><strong><a href="#sail-masbate-to-cebu">Sail from Masbate Port to Cebu City Port</a></strong></li>



<li><a href="#summary"><strong>Cost and Travel Time</strong></a></li>



<li><a href="#bookingnumbers"><strong>Booking Phone Numbers</strong></a></li>
</ul>



<div style="height:36px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size wp-block-paragraph">We recently transported a <strong>Toyota Fortuner 2012</strong> from <strong>Luzon to Cebu</strong> using <strong>RoRo ships</strong> (Roll-on, Roll-off).</p>



<p class="has-medium-font-size wp-block-paragraph">To make the journey, we traveled to the <strong>southern part of Luzon</strong> and boarded a RoRo ship to Masbate. From <strong>Masbate</strong>, we took another RoRo ship to <strong>Cebu</strong>.</p>



<p class="has-medium-font-size wp-block-paragraph">To ensure a smooth trip, it was important to time our arrival in <strong>Masbate</strong> before the departure of the RoRo ship to <strong>Cebu City port</strong>. This particular ship only operates once a week, every <strong>Sunday at 7 pm</strong>, with an estimated travel time of <strong>12 hours</strong>, arriving at Cebu City port the following morning at <strong>7 am</strong>.</p>



<p class="has-medium-font-size wp-block-paragraph">If you have flexibility in your schedule or are willing to arrive in the <strong>northern part of Cebu (Bogo)</strong>, there is an alternative option. The porter staff at <strong>Pilar, Sorsogon port</strong> mentioned that there is a daily RoRo ship from <strong>Cataingan port in Masbate</strong> to <strong>Cebu</strong>. However, it&#8217;s important to verify this information, as I did not personally choose this option. They mentioned that <strong>M/V Cokaliong</strong> sails to Cebu on Saturdays, which turned out to be incorrect.</p>



<div style="height:24px" aria-hidden="true" class="wp-block-spacer"></div>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Single-row Horizontal -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-7317245021228731"
     data-ad-slot="2931534497"
     data-ad-format="auto"
     data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<div style="height:48px" aria-hidden="true" id="drive-to-pio-duran" class="wp-block-spacer"></div>



<h2 class="wp-block-heading has-large-font-size"><strong>By Land: Drive to Pio Duran Port in southern part of Luzon</strong></h2>



<p class="has-medium-font-size wp-block-paragraph">For our journey, we had two choices for the departure port in Luzon: <strong>Pilar port in Sorsogon</strong> or <strong>Pio Duran port in Albay</strong>. Pio Duran port was the closer option, approximately an hour away from Pilar.</p>



<p class="has-medium-font-size wp-block-paragraph">We decided to depart from <strong>Pio Duran port</strong> because there was a suitable RoRo ship that sailed at <strong>11 am</strong>, heading to <strong>Masbate port</strong>. This allowed us to catch the ship to Cebu on the same day at <strong>7 pm</strong>, with the advantage of arriving directly in <strong>Cebu City</strong>.</p>



<p class="has-medium-font-size wp-block-paragraph">The road leading to <strong>Pio Duran port in Albay</strong> was cemented but had some bumps and frequent truck traffic, making it challenging to maintain speeds above <strong>80 km/h</strong>. On average, we traveled at around <strong>60 km/h</strong>. From <strong>Imus, Cavite</strong> to Pio Duran port in Albay, the journey took us <strong>12 hours</strong>. We encountered heavy traffic on the way due to it being a <strong>Saturday</strong> and an incident involving a truck falling off the road, which added an extra hour of delay.</p>



<p class="has-medium-font-size wp-block-paragraph">When planning your own trip, it is important to consider potential incidents and allocate sufficient time. We departed from Imus, Cavite at <strong>5 pm</strong>, giving us ample time to reach Pio Duran port without rushing and allowing for sightseeing along the way, reducing stress.</p>



<div style="height:24px" aria-hidden="true" class="wp-block-spacer"></div>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Single-row Horizontal -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-7317245021228731"
     data-ad-slot="2931534497"
     data-ad-format="auto"
     data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<div style="height:48px" aria-hidden="true" id="sail-pio-duran-to-masbate" class="wp-block-spacer"></div>



<h2 class="wp-block-heading has-large-font-size"><strong>By Sea: Sail from Pio Duran Port to Masbate Port</strong></h2>



<p class="has-medium-font-size wp-block-paragraph">To travel from <strong>Pio Duran port</strong> to <strong>Masbate port</strong>, it is crucial to arrive as early as possible. <strong>Santa Clara Shipping Corporation</strong> operates the RoRo ship, which can only accommodate <strong>10 light vehicles</strong>. Once the limit is reached, no additional vehicles are accepted. It&#8217;s worth noting that their office is not located inside the port, so if no one is present to assist, there is a risk of missing the ship. Please refer to the provided location details.</p>



<p class="has-medium-font-size wp-block-paragraph">To secure a ticket, visit the <strong>Santa Clara Shipping Corporation office</strong> and present the <strong>Official Receipt (OR)</strong> and <strong>Certificate of Registration (CR)</strong> for your vehicle. The cost for my <strong>Toyota Fortuner 2012</strong>, including the driver, was <strong>PHP 2,800</strong>. Additionally, there is a Terminal Ticket fee of <strong>PHP 30</strong> and a payment of <strong>PHP 129</strong> to the <strong>Philippine Ports Authority (PPA)</strong>. The ticket must be signed by the <strong>Gate Guards and Coast Guards</strong>, and you will need to present the OR and CR again during these processes.</p>



<p class="has-medium-font-size wp-block-paragraph">Once all these steps are completed, proceed to the designated <strong>vehicle waiting area</strong>.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" width="1024" height="726" src="https://www.caskispace.com/wp-content/uploads/2023/05/pio-duran-1024x726.jpg" alt="Car Transport: Pio Duran Port Map" class="wp-image-12435" srcset="https://www.caskispace.com/wp-content/uploads/2023/05/pio-duran-1024x726.jpg 1024w, https://www.caskispace.com/wp-content/uploads/2023/05/pio-duran-300x213.jpg 300w, https://www.caskispace.com/wp-content/uploads/2023/05/pio-duran-768x545.jpg 768w, https://www.caskispace.com/wp-content/uploads/2023/05/pio-duran-1536x1090.jpg 1536w, https://www.caskispace.com/wp-content/uploads/2023/05/pio-duran.jpg 1727w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">Pio Duran Port Map</figcaption></figure>
</div>


<p class="wp-block-paragraph"></p>



<p class="has-medium-font-size wp-block-paragraph">For any assistance, you can contact <strong>JR at (0981) 353-5665</strong>. He provided his contact information in case you require any help during your journey.</p>



<p class="has-medium-font-size wp-block-paragraph">The <strong>M/V Santa Clara</strong>, which we boarded, typically takes around <strong>5 hours</strong> to reach Masbate. However, in our case, the departure time was slightly delayed from the scheduled <strong>11 am</strong>, resulting in our arrival in Masbate around <strong>5:30-6:00 pm</strong>. This left us with only an hour to purchase tickets for the Cebu-bound RoRo ship. We had to hurry, but fortunately, we made it just in time before the loading of vehicles onto the M/V Cokaliong commenced.</p>



<p class="has-medium-font-size wp-block-paragraph">For schedules, contact <a href="https://www.facebook.com/santaclarashippingcorporation" target="_blank" rel="noreferrer noopener">Santa Clara Shipping Lines on Facebook</a>.</p>



<div style="height:24px" aria-hidden="true" class="wp-block-spacer"></div>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Single-row Horizontal -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-7317245021228731"
     data-ad-slot="2931534497"
     data-ad-format="auto"
     data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<div style="height:48px" aria-hidden="true" id="sail-masbate-to-cebu" class="wp-block-spacer"></div>



<h2 class="wp-block-heading has-large-font-size"><strong>By Sea: Sail from Masbate Port to Cebu City Port</strong></h2>



<p class="has-medium-font-size wp-block-paragraph">Once in <strong>Masbate port</strong>, it&#8217;s important to note that you should not exit the port immediately. When your vehicle is offloaded from the ship, inform the guard that you intend to board the <strong>M/V Cokaliong</strong> for the <strong>7 pm</strong> trip to <strong>Cebu City</strong>. They will direct you to the <strong>vehicle waiting area</strong> (refer to the provided location details). Leave your vehicle in the waiting area and purchase a ticket from <strong>Cokaliong Shipping Lines</strong>. Remember to bring your <strong>OR and CR</strong> for the ticketing process. The Cokaliong office is located outside the port area and may require some inquiry to locate. At the time of writing, it is a small yellow store along the roadside (see location details).</p>



<p class="has-medium-font-size wp-block-paragraph">Once you have purchased the ticket, the salesperson will request you to obtain a <strong>Terminal Ticket</strong>, which costs <strong>PHP 30</strong>. After acquiring the Terminal Ticket, return to the salesperson to pay for the tickets for both your vehicle and passengers. In my case, I paid <strong>PHP 7,070.00</strong> for myself and my <strong>Toyota Fortuner 2012</strong>.</p>



<p class="has-medium-font-size wp-block-paragraph">Upon completion of the ticketing process, you will need to get the Coast Guard&#8217;s signature. Present your OR and CR once again for this step.</p>



<p class="has-medium-font-size wp-block-paragraph">For schedules, check the <a href="http://cokaliongshipping.com" target="_blank" rel="noreferrer noopener">Cokaliong Shipping Lines website</a>.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" width="1024" height="726" src="https://www.caskispace.com/wp-content/uploads/2023/05/masbate-1024x726.jpg" alt="Car Transport: Masbate Port Map" class="wp-image-12441" srcset="https://www.caskispace.com/wp-content/uploads/2023/05/masbate-1024x726.jpg 1024w, https://www.caskispace.com/wp-content/uploads/2023/05/masbate-300x213.jpg 300w, https://www.caskispace.com/wp-content/uploads/2023/05/masbate-768x545.jpg 768w, https://www.caskispace.com/wp-content/uploads/2023/05/masbate-1536x1090.jpg 1536w, https://www.caskispace.com/wp-content/uploads/2023/05/masbate.jpg 1727w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">Masbate Port Map</figcaption></figure>
</div>


<p class="has-medium-font-size wp-block-paragraph">Now, you are all set to embark on the journey. Approach the staff near the Cokaliong ship and inquire about parking your car for loading to ensure you don&#8217;t miss the departure. They will notify you once the ship is ready, and you might spot a guard on a motorcycle approaching your car to inform you.</p>



<p class="has-medium-font-size wp-block-paragraph">Wishing you happy travels on your journey from Luzon to Cebu!</p>



<div style="height:48px" aria-hidden="true" id="summary" class="wp-block-spacer"></div>



<h2 class="wp-block-heading has-large-font-size"><strong>Bring Car to Cebu from Manila Summary</strong></h2>



<ol class="wp-block-list">
<li>From Pio Duran port to Masbate port:
<ul class="wp-block-list">
<li>Ticket cost from Santa Clara Shipping Corporation: PHP 2,800.00 (for the vehicle, including the driver)</li>



<li>Terminal Ticket fee: PHP 30.00</li>



<li>Payment to Philippine Ports Authority (PPA): PHP 129.00</li>
</ul>
</li>



<li>From Masbate port to Cebu City port:
<ul class="wp-block-list">
<li>Ticket cost from Cokaliong Shipping Lines: PHP 7,070.00 (for the vehicle and passengers)</li>



<li>Terminal Ticket fee: PHP 30.00</li>
</ul>
</li>
</ol>



<p class="wp-block-paragraph"></p>



<p class="has-medium-font-size wp-block-paragraph">All in all it took me <strong>PHP 10,059</strong> give or take to transport my car from <strong>Manila to Cebu</strong>. Took me <strong>12 hours of driving</strong> and <strong>17 hours on-board a RoRo Ship</strong>.</p>



<p class="has-medium-font-size wp-block-paragraph">Please note that these fees are based on the information provided in the passage and may be subject to change. It&#8217;s always a good idea to double-check the fees with the respective shipping companies before your journey to ensure accurate and up-to-date information.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading has-large-font-size" id="bookingnumbers"><strong>Booking Contact Numbers</strong></h2>



<p class="wp-block-paragraph">Last update: July 29, 2024</p>



<p class="has-medium-font-size wp-block-paragraph" id="bookingnumbers"><strong>Pio Duran</strong></p>



<ul class="wp-block-list">
<li>CAVS (0920-314-8995)</li>



<li>Santa Clara (0909-764-9277)</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p class="has-medium-font-size wp-block-paragraph">For more travel guides/tips, feel free to browse our <a href="https://www.caskispace.com/travel-guide/">Travel Guide page</a>.</p>
<p>The post <a href="https://www.caskispace.com/cheapest-way-to-bring-your-car-to-cebu-from-manila/">CHEAPEST WAY to Bring your Car to Cebu from Manila: RoRo Cebu to Manila, Manila to Cebu</a> appeared first on <a href="https://www.caskispace.com">caskiSPACE</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.caskispace.com/cheapest-way-to-bring-your-car-to-cebu-from-manila/feed/</wfw:commentRss>
			<slash:comments>25</slash:comments>
		
		
			</item>
		<item>
		<title>Call ChromeData in NodeJS and PHP</title>
		<link>https://www.caskispace.com/call-chromedata-in-nodejs-and-php/</link>
		
		<dc:creator><![CDATA[saborot]]></dc:creator>
		<pubDate>Sat, 06 Nov 2021 07:34:52 +0000</pubDate>
				<category><![CDATA[Code Crumbs]]></category>
		<guid isPermaLink="false">https://www.caskispace.com/?p=11875</guid>

					<description><![CDATA[<p>In this code crumb, we will call ChromeData in NodeJS and PHP. We will call the &#8220;describeVehicle&#8221; method of ChromeData ADS(Automotive Description Service). The &#8220;describeVehicle&#8221; method accepts a vehicle&#8217;s VIN, searches its database for a match then responds with information for that vehicle. ChromeData uses WSDL and one way for us to make use of its [&#8230;]</p>
<p>The post <a href="https://www.caskispace.com/call-chromedata-in-nodejs-and-php/">Call ChromeData in NodeJS and PHP</a> appeared first on <a href="https://www.caskispace.com">caskiSPACE</a>.</p>
]]></description>
										<content:encoded><![CDATA[		<div data-elementor-type="wp-post" data-elementor-id="11875" class="elementor elementor-11875" data-elementor-post-type="post">
						<section class="elementor-section elementor-top-section elementor-element elementor-element-3099518 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="3099518" data-element_type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-6e483f3" data-id="6e483f3" data-element_type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-fb3a36e elementor-widget elementor-widget-text-editor" data-id="fb3a36e" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									<p><span style="color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-size: 1rem;">In this code crumb, we will call ChromeData in NodeJS and PHP.</span></p><p><span style="color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-size: 1rem;">We will call the &#8220;describeVehicle&#8221; method of ChromeData ADS(</span>Automotive Description Service<span style="color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-size: 1rem;">). The &#8220;describeVehicle&#8221; method accepts a vehicle&#8217;s VIN, searches its database for a match then responds with information for that vehicle.</span></p><p><span style="color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-size: 1rem;">ChromeData uses WSDL and one way for us to make use of its services is to connect to it by passing our credentials along with our request parameters using SOAP(Simple Object Access Protocol).</span></p><p><span style="color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-size: 1rem;">The process is pretty much the same between languages, however there is one key difference when passing credentials using NodeJS &#8220;node-soap&#8221; module. It seems that in NodeJS, we need to explicitly tell the module  to treat the credentials(number, secret, country, language) as attributes of the AccountInfo XML element instead of children. This is something we don&#8217;t have to explicitly define when passing our request parameters to SoapClient in PHP.</span></p>								</div>
				</div>
				<div class="elementor-element elementor-element-308e326 elementor-widget elementor-widget-template" data-id="308e326" data-element_type="widget" data-widget_type="template.default">
				<div class="elementor-widget-container">
							<div class="elementor-template">
					<div data-elementor-type="section" data-elementor-id="311" class="elementor elementor-311" data-elementor-post-type="elementor_library">
					<section class="elementor-section elementor-top-section elementor-element elementor-element-1c9461bb elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="1c9461bb" data-element_type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-3c156f23" data-id="3c156f23" data-element_type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-4ad0f189 elementor-widget elementor-widget-html" data-id="4ad0f189" data-element_type="widget" data-widget_type="html.default">
				<div class="elementor-widget-container">
					<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Single-row Horizontal -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-7317245021228731"
     data-ad-slot="2931534497"
     data-ad-format="auto"
     data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>				</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				</div>
				</div>
						</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				<section class="elementor-section elementor-top-section elementor-element elementor-element-f44ad9e elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="f44ad9e" data-element_type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-3355e5e" data-id="3355e5e" data-element_type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-e3a07ac elementor-widget elementor-widget-heading" data-id="e3a07ac" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
					<h2 class="elementor-heading-title elementor-size-default">Using PHP</h2>				</div>
				</div>
				<div class="elementor-element elementor-element-f0672c9 elementor-widget elementor-widget-accordion" data-id="f0672c9" data-element_type="widget" data-widget_type="accordion.default">
				<div class="elementor-widget-container">
							<div class="elementor-accordion">
							<div class="elementor-accordion-item">
					<div id="elementor-tab-title-2521" class="elementor-tab-title" data-tab="1" role="button" aria-controls="elementor-tab-content-2521" aria-expanded="false">
												<a class="elementor-accordion-title" tabindex="0">Step 1. Prepare Request Parameters</a>
					</div>
					<div id="elementor-tab-content-2521" class="elementor-tab-content elementor-clearfix" data-tab="1" role="region" aria-labelledby="elementor-tab-title-2521"><h4>Prepare Request Parameters</h4>

<div class="code color-green">
<pre>
$url = 'http://services.chromedata.com/Description/7c?wsdl';
$request_params = [
    'accountInfo' => [
        'number'=>'12345',
        'secret'=>'A12B345C67890123',
        'country'=>'US',
        'language' =>'en'    
    ],
    'vin' => '5GAKVCED2CJ310674',
];
</pre>
</div></div>
				</div>
							<div class="elementor-accordion-item">
					<div id="elementor-tab-title-2522" class="elementor-tab-title" data-tab="2" role="button" aria-controls="elementor-tab-content-2522" aria-expanded="false">
												<a class="elementor-accordion-title" tabindex="0">Step 2. Create a SOAP Client</a>
					</div>
					<div id="elementor-tab-content-2522" class="elementor-tab-content elementor-clearfix" data-tab="2" role="region" aria-labelledby="elementor-tab-title-2522"><h4>Step 2. Create a SOAP Client</h4><p>References: <a href="https://www.php.net/manual/en/class.soapclient.php" target="_blank" rel="noopener">SoapClient</a></p><hr /><div class="code color-green"><pre>try {
    $client = new SoapClient($url);
} catch (SoapFault $e) {
    $msg = 'chrome_ads_get_client -- Could not get client. ' . $e-&gt;getMessage();
}
</pre></div></div>
				</div>
							<div class="elementor-accordion-item">
					<div id="elementor-tab-title-2523" class="elementor-tab-title" data-tab="3" role="button" aria-controls="elementor-tab-content-2523" aria-expanded="false">
												<a class="elementor-accordion-title" tabindex="0">Step 3. Call the ChromeData ADS "describeVehicle" Method</a>
					</div>
					<div id="elementor-tab-content-2523" class="elementor-tab-content elementor-clearfix" data-tab="3" role="region" aria-labelledby="elementor-tab-title-2523"><h4>Call the ChromeData ADS &#8220;describeVehicle&#8221; Method</h4>

<div class="code color-green">
<pre>
try {
    $response = $client->__soapCall('describeVehicle', [$request_params]);
} catch (Exception $e) {
    $msg = 'chrome_ads_describe_vehicle -- Could not get data. ' . $e->getMessage();
}
</pre>
</div></div>
				</div>
								</div>
						</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				<section class="elementor-section elementor-top-section elementor-element elementor-element-f0c694b elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="f0c694b" data-element_type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-be7c884" data-id="be7c884" data-element_type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-5987ec3 elementor-widget elementor-widget-spacer" data-id="5987ec3" data-element_type="widget" data-widget_type="spacer.default">
				<div class="elementor-widget-container">
							<div class="elementor-spacer">
			<div class="elementor-spacer-inner"></div>
		</div>
						</div>
				</div>
				<div class="elementor-element elementor-element-a453da2 elementor-widget elementor-widget-heading" data-id="a453da2" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
					<h2 class="elementor-heading-title elementor-size-default">Using Node JS</h2>				</div>
				</div>
				<div class="elementor-element elementor-element-296b74c elementor-widget elementor-widget-accordion" data-id="296b74c" data-element_type="widget" data-widget_type="accordion.default">
				<div class="elementor-widget-container">
							<div class="elementor-accordion">
							<div class="elementor-accordion-item">
					<div id="elementor-tab-title-4341" class="elementor-tab-title" data-tab="1" role="button" aria-controls="elementor-tab-content-4341" aria-expanded="false">
												<a class="elementor-accordion-title" tabindex="0">Step 1. Prepare Request Parameters</a>
					</div>
					<div id="elementor-tab-content-4341" class="elementor-tab-content elementor-clearfix" data-tab="1" role="region" aria-labelledby="elementor-tab-title-4341"><h4>Prepare Request Parameters</h4><p><span class="color-red"><strong>NOTE:</strong> </span>The &#8220;AccountInfo&#8221; parameter here is written differently than how we are doing it on PHP. In the code below, we are explicitly defining that <strong>&#8220;number&#8221;, &#8220;secret&#8221;, &#8220;country&#8221; and &#8220;language&#8221; are attributes of &#8220;AccountInfo&#8221;</strong>. If we do not do it this way, the resulting request XML would treat those as children of AccountInfo rather than attributes resulting in an <strong>&#8220;Unable to authenticate account &#8211;**UNKNOWN**&#8211;&#8220;</strong> error.</p><hr /><div class="code color-green"><pre>const url = 'http://services.chromedata.com/Description/7c?wsdl';
const requestParams = {
    accountInfo: {
        attributes: {
            number: '12345',
            secret: 'A12B345C67890123',
            country: 'US',
            language: 'en'
        }
    },
    vin: '5GAKVCED2CJ310674,
};
</pre></div></div>
				</div>
							<div class="elementor-accordion-item">
					<div id="elementor-tab-title-4342" class="elementor-tab-title" data-tab="2" role="button" aria-controls="elementor-tab-content-4342" aria-expanded="false">
												<a class="elementor-accordion-title" tabindex="0">Step 2. Install Required Modules</a>
					</div>
					<div id="elementor-tab-content-4342" class="elementor-tab-content elementor-clearfix" data-tab="2" role="region" aria-labelledby="elementor-tab-title-4342"><h4>Install Required Modules</h4>
References: <a href="https://www.php.net/manual/en/class.soapclient.php" target="_blank" rel="noopener">vpulim/node-soap</a>, <a href="https://www.npmjs.com/package/@types/sax" target="_blank" rel="noopener">@types/Sax</a>

<hr />

<br>In your command line interface, install &#8220;soap&#8221; and it&#8217;s build dependency &#8220;@types/sax&#8221;

<div class="code color-green">
<pre>
npm install soap
npm install --save-dev @types/sax
</pre>
</div></div>
				</div>
							<div class="elementor-accordion-item">
					<div id="elementor-tab-title-4343" class="elementor-tab-title" data-tab="3" role="button" aria-controls="elementor-tab-content-4343" aria-expanded="false">
												<a class="elementor-accordion-title" tabindex="0">Step 3. Create a SOAP Client</a>
					</div>
					<div id="elementor-tab-content-4343" class="elementor-tab-content elementor-clearfix" data-tab="3" role="region" aria-labelledby="elementor-tab-title-4343"><h4>Create a SOAP Client</h4>

<div class="code color-green">
<pre>
const soap = require('soap');
const soapClient = await soap.createClientAsync(url);
</pre>
</div></div>
				</div>
							<div class="elementor-accordion-item">
					<div id="elementor-tab-title-4344" class="elementor-tab-title" data-tab="4" role="button" aria-controls="elementor-tab-content-4344" aria-expanded="false">
												<a class="elementor-accordion-title" tabindex="0">Step 4. Call the ChromeData ADS "describeVehicle" Method</a>
					</div>
					<div id="elementor-tab-content-4344" class="elementor-tab-content elementor-clearfix" data-tab="4" role="region" aria-labelledby="elementor-tab-title-4344"><h4>Call the ChromeData ADS &#8220;describeVehicle&#8221; Method</h4><div class="code color-green"><pre>const results = await soapClient['describeVehicleAsync']([<span style="font-size: 1em;">requestParams</span><span style="font-size: 1em;">]);</span></pre></div></div>
				</div>
								</div>
						</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				<section class="elementor-section elementor-top-section elementor-element elementor-element-7fc21f9 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="7fc21f9" data-element_type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-b756090" data-id="b756090" data-element_type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-56a9374 elementor-widget elementor-widget-spacer" data-id="56a9374" data-element_type="widget" data-widget_type="spacer.default">
				<div class="elementor-widget-container">
							<div class="elementor-spacer">
			<div class="elementor-spacer-inner"></div>
		</div>
						</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				</div>
		<p>The post <a href="https://www.caskispace.com/call-chromedata-in-nodejs-and-php/">Call ChromeData in NodeJS and PHP</a> appeared first on <a href="https://www.caskispace.com">caskiSPACE</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Upload Ads.txt to Bitnami Web Server</title>
		<link>https://www.caskispace.com/upload-ads-txt-to-bitnami-web-server/</link>
		
		<dc:creator><![CDATA[saborot]]></dc:creator>
		<pubDate>Tue, 02 Nov 2021 05:02:56 +0000</pubDate>
				<category><![CDATA[Code Crumbs]]></category>
		<guid isPermaLink="false">https://www.caskispace.com/?p=11854</guid>

					<description><![CDATA[<p>This seems easy but I spent some time googling it on the internet and did not find a straight answer.  I had to move my WordPress site to an AWS LightSail due to some technical issue with my previous web host and I didn&#8217;t know where to put my Ads.txt.  To cut things short, AWS [&#8230;]</p>
<p>The post <a href="https://www.caskispace.com/upload-ads-txt-to-bitnami-web-server/">Upload Ads.txt to Bitnami Web Server</a> appeared first on <a href="https://www.caskispace.com">caskiSPACE</a>.</p>
]]></description>
										<content:encoded><![CDATA[		<div data-elementor-type="wp-post" data-elementor-id="11854" class="elementor elementor-11854" data-elementor-post-type="post">
						<section class="elementor-section elementor-top-section elementor-element elementor-element-3099518 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="3099518" data-element_type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-6e483f3" data-id="6e483f3" data-element_type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-fb3a36e elementor-widget elementor-widget-text-editor" data-id="fb3a36e" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									<p>This seems easy but I spent some time googling it on the internet and did not find a straight answer.  I had to move my WordPress site to an AWS LightSail due to some technical issue with my previous web host and I didn&#8217;t know where to put my Ads.txt. </p><p>To cut things short, AWS LightSail&#8217;s Linux + WordPress uses Bitnami and the root directory for its web server is on <b>/OPT/BITNAMI/WORDPRESS.</b></p><p>Just drop your Ads.txt in that directory and you should be good. Once you have uploaded your Ads.txt, you should be able to access it using a browser by going to <b>www.{yourdomain.com}/ads.txt</b>.</p><p>If you are using a different setup or prefer not to deal with technicalities, you can use a WordPress plugin. Login to your WordPress site and add the &#8216;<a href="https://wordpress.org/plugins/wp-file-manager/" target="_blank" rel="noopener">File Manager</a>&#8216; plugin. This plugin will show you the root directory of your WordPress site and from there you can upload to it directly.</p>								</div>
				</div>
				<div class="elementor-element elementor-element-308e326 elementor-widget elementor-widget-template" data-id="308e326" data-element_type="widget" data-widget_type="template.default">
				<div class="elementor-widget-container">
							<div class="elementor-template">
					<div data-elementor-type="section" data-elementor-id="311" class="elementor elementor-311" data-elementor-post-type="elementor_library">
					<section class="elementor-section elementor-top-section elementor-element elementor-element-1c9461bb elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="1c9461bb" data-element_type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-3c156f23" data-id="3c156f23" data-element_type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-4ad0f189 elementor-widget elementor-widget-html" data-id="4ad0f189" data-element_type="widget" data-widget_type="html.default">
				<div class="elementor-widget-container">
					<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Single-row Horizontal -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-7317245021228731"
     data-ad-slot="2931534497"
     data-ad-format="auto"
     data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>				</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				</div>
				</div>
						</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				<section class="elementor-section elementor-top-section elementor-element elementor-element-7fc21f9 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="7fc21f9" data-element_type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-b756090" data-id="b756090" data-element_type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-56a9374 elementor-widget elementor-widget-spacer" data-id="56a9374" data-element_type="widget" data-widget_type="spacer.default">
				<div class="elementor-widget-container">
							<div class="elementor-spacer">
			<div class="elementor-spacer-inner"></div>
		</div>
						</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				</div>
		<p>The post <a href="https://www.caskispace.com/upload-ads-txt-to-bitnami-web-server/">Upload Ads.txt to Bitnami Web Server</a> appeared first on <a href="https://www.caskispace.com">caskiSPACE</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Query Database Using WordPress REST</title>
		<link>https://www.caskispace.com/how-to-query-wp-database-using-wp-rest/</link>
		
		<dc:creator><![CDATA[saborot]]></dc:creator>
		<pubDate>Sat, 05 Dec 2020 16:22:52 +0000</pubDate>
				<category><![CDATA[Code Crumbs]]></category>
		<guid isPermaLink="false">https://caskispace.com/?p=2893</guid>

					<description><![CDATA[<p>This code crumb will query a WordPress database using WP REST. It tackles all the basic steps to interact and get data from the WordPress database in three different ways; directly from the browser using a URL, calling from a PHP function or by a user-driven event from the front-end interface using Javascript which will [&#8230;]</p>
<p>The post <a href="https://www.caskispace.com/how-to-query-wp-database-using-wp-rest/">Query Database Using WordPress REST</a> appeared first on <a href="https://www.caskispace.com">caskiSPACE</a>.</p>
]]></description>
										<content:encoded><![CDATA[		<div data-elementor-type="wp-post" data-elementor-id="2893" class="elementor elementor-2893" data-elementor-post-type="post">
						<section class="elementor-section elementor-top-section elementor-element elementor-element-3099518 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="3099518" data-element_type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-6e483f3" data-id="6e483f3" data-element_type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-fb3a36e elementor-widget elementor-widget-text-editor" data-id="fb3a36e" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									<p>This code crumb will query a WordPress database using WP REST. It tackles all the basic steps to interact and get data from the WordPress database in three different ways; directly from the browser using a URL, calling from a PHP function or by a user-driven event from the front-end interface using Javascript which will then call a PHP function which in turn will query the database and return the result.</p>								</div>
				</div>
				<div class="elementor-element elementor-element-308e326 elementor-widget elementor-widget-template" data-id="308e326" data-element_type="widget" data-widget_type="template.default">
				<div class="elementor-widget-container">
							<div class="elementor-template">
					<div data-elementor-type="section" data-elementor-id="311" class="elementor elementor-311" data-elementor-post-type="elementor_library">
					<section class="elementor-section elementor-top-section elementor-element elementor-element-1c9461bb elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="1c9461bb" data-element_type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-3c156f23" data-id="3c156f23" data-element_type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-4ad0f189 elementor-widget elementor-widget-html" data-id="4ad0f189" data-element_type="widget" data-widget_type="html.default">
				<div class="elementor-widget-container">
					<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Single-row Horizontal -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-7317245021228731"
     data-ad-slot="2931534497"
     data-ad-format="auto"
     data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>				</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				</div>
				</div>
						</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				<section class="elementor-section elementor-top-section elementor-element elementor-element-f44ad9e elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="f44ad9e" data-element_type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-3355e5e" data-id="3355e5e" data-element_type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-f0672c9 elementor-widget elementor-widget-accordion" data-id="f0672c9" data-element_type="widget" data-widget_type="accordion.default">
				<div class="elementor-widget-container">
							<div class="elementor-accordion">
							<div class="elementor-accordion-item">
					<div id="elementor-tab-title-2521" class="elementor-tab-title" data-tab="1" role="button" aria-controls="elementor-tab-content-2521" aria-expanded="false">
												<a class="elementor-accordion-title" tabindex="0">Step 1. Register an Endpoint</a>
					</div>
					<div id="elementor-tab-content-2521" class="elementor-tab-content elementor-clearfix" data-tab="1" role="region" aria-labelledby="elementor-tab-title-2521"><h4>Register an Endpoint</h4>
<div class="instructions">
<ul>
 	<li class="color-blue">Create a function which will contain the route registration.</li>
 	<li class="color-green">Define the endpoint&#8217;s route using <a href="https://developer.wordpress.org/reference/functions/register_rest_route/" target="_blank" rel="noopener">&#8216;register_rest_route&#8217;</a>.</li>
 	<li class="color-orange">Add the function to the <a href="https://developer.wordpress.org/reference/hooks/rest_api_init/" target="_blank" rel="noopener">&#8216;rest_api_init&#8217;</a> hook</li>
</ul>
</div>
<div class="instructions-summary">

<hr />

<div class="code color-blue">function register_route() {</div>
<div class="code color-green">
<pre>   register_rest_route('get-user/v1', '/first/(?P&lt;first>.+)/last/(?P&lt;last>.+)', [
      'methods' =&gt; 'GET',
      'callback' =&gt; 'get_user_callback',
      'permission_callback' =&gt; '__return_true',
   ]);
</pre>
</div>
<div class="code color-blue">}</div>
<div class="code color-orange">
<pre>add_action('rest_api_init', 'register_route');</pre>
</div>
</div></div>
				</div>
							<div class="elementor-accordion-item">
					<div id="elementor-tab-title-2522" class="elementor-tab-title" data-tab="2" role="button" aria-controls="elementor-tab-content-2522" aria-expanded="false">
												<a class="elementor-accordion-title" tabindex="0">Step 2. Create a Callback Function to Query the Database</a>
					</div>
					<div id="elementor-tab-content-2522" class="elementor-tab-content elementor-clearfix" data-tab="2" role="region" aria-labelledby="elementor-tab-title-2522"><h4>Step 2. Create the Callback Function that Will Query the Database</h4>
<div class="instructions">
<ul>
 	<li class="color-blue">Create the callback function for the endpoint</li>
 	<li class="color-green">Get reference to the WordPress Database Access object (<a href="https://developer.wordpress.org/reference/classes/wpdb/" target="_blank" rel="noopener">wpdb</a>).</li>
 	<li class="color-orange">Get the parameters passed to the endpoint.</li>
 	<li class="color-purple">Prepare the database query using <a href="https://developer.wordpress.org/reference/classes/wpdb/prepare/" target="_blank" rel="noopener">wpdb-&gt;prepare</a>. Use &#8216;%s&#8217; for string, &#8216;%d&#8217; for integer and &#8216;%f&#8217; for float values.</li>
 	<li class="color-brown">Query the database and get results. Use <a href="https://developer.wordpress.org/reference/classes/wpdb/get_results/" target="_blank" rel="noopener">wpdb-&gt;get_results</a> for SELECT statements and <a href="https://developer.wordpress.org/reference/classes/wpdb/query/" target="_blank" rel="noopener">wpdb-&gt;query</a> for DELETE/UPDATE.</li>
 	<li class="color-teal">Return the data in a <a href="https://developer.wordpress.org/reference/classes/wp_rest_response/" target="_blank" rel="noopener">WP_REST_Response</a> object.</li>
</ul>
</div>
<div class="instructions-summary">

<hr />

<div class="code color-blue">function get_user_callback(WP_REST_Request $request) {</div>
<div class="code color-green">
<pre>   global $wpdb;
</pre>
</div>
<div class="code color-orange">
<pre>   $first_name = urldecode($request-&gt;get_param( 'first' ));
   $last_name = urldecode($request-&gt;get_param( 'last' ));
</pre>
</div>
<div class="code color-purple">
<pre>   $query = "SELECT * FROM 'users_table' WHERE 'first_name' = %s AND 'last_name' = %s";
   $prepared_query = $wpdb-&gt;prepare($query, $first_name, $last_name);
</pre>
</div>
<div class="code row1 color-brown">
<pre>   $data = $wpdb-&gt;get_results($prepared_query);
</pre>
</div>
<div class="code color-teal">
<pre>   return new WP_REST_Response($data);
</pre>
</div>
<div class="code color-blue">}</div>
</div></div>
				</div>
							<div class="elementor-accordion-item">
					<div id="elementor-tab-title-2523" class="elementor-tab-title" data-tab="3" role="button" aria-controls="elementor-tab-content-2523" aria-expanded="false">
												<a class="elementor-accordion-title" tabindex="0">Step 3.a Call Directly From a Browser using a URL</a>
					</div>
					<div id="elementor-tab-content-2523" class="elementor-tab-content elementor-clearfix" data-tab="3" role="region" aria-labelledby="elementor-tab-title-2523"><h4>Call Call Directly From a Browser using a URL</h4><div class="instructions"><ul><li class="color-blue">Call directly from a browser by prefixing the Route with <small>/wp-json/</small>.</li></ul></div><div class="instructions-summary"><hr /><p>With parameters: (first name = &#8216;Gieon Felice&#8217; and last name = &#8216;Aborot&#8217;)</p><div class="code color-blue"><br />https://yourdomain.com/wp-json/get-user/v1/first/Gieon Felice/last/Aborot</div></div></div>
				</div>
							<div class="elementor-accordion-item">
					<div id="elementor-tab-title-2524" class="elementor-tab-title" data-tab="4" role="button" aria-controls="elementor-tab-content-2524" aria-expanded="false">
												<a class="elementor-accordion-title" tabindex="0">Step 3.b Call the Endpoint Using PHP</a>
					</div>
					<div id="elementor-tab-content-2524" class="elementor-tab-content elementor-clearfix" data-tab="4" role="region" aria-labelledby="elementor-tab-title-2524"><h4>Call the Endpoint From PHP</h4><div class="instructions"><ul><li class="color-blue">Use <a href="https://developer.wordpress.org/reference/functions/wp_remote_get/" target="_blank" rel="noopener">wp_remote_get</a> to request data from the endpoint.</li><li class="color-green">Handle errors and unsuccessful requests using <a href="https://developer.wordpress.org/reference/functions/is_wp_error/" target="_blank" rel="noopener">is_wp_error</a> and <a href="https://www.php.net/manual/en/reserved.variables.server.php" target="_blank" rel="noopener">WP_Error</a>.</li><li class="color-orange">Finally use <a href="https://developer.wordpress.org/reference/functions/wp_remote_retrieve_body/" target="_blank" rel="noopener">wp_remote_retrieve_body</a> to get the response.</li></ul></div><div class="instructions-summary"><hr /><p>function call_from_php() {</p><div class="code color-blue"><pre>   $response = wp_remote_get(
      "https://yourdomain.com/wp-json/get-user/v1/first/Gieon Felice/last/Aborot", [
         'sslverify' =&gt; false,
      ]
   );
</pre></div><div class="code color-green"><pre>   if ( is_wp_error( $response ) ) {
      return new WP_Error( 'call_from_php unsuccessful', $response-&gt;get_error_message() );
   }
</pre></div><div class="code color-orange"><pre>   return wp_remote_retrieve_body($response);
</pre></div><p>}</p></div></div>
				</div>
							<div class="elementor-accordion-item">
					<div id="elementor-tab-title-2525" class="elementor-tab-title" data-tab="5" role="button" aria-controls="elementor-tab-content-2525" aria-expanded="false">
												<a class="elementor-accordion-title" tabindex="0">Step 3.c Trigger the Call to the Endpoint From the Front-end Using Javascript</a>
					</div>
					<div id="elementor-tab-content-2525" class="elementor-tab-content elementor-clearfix" data-tab="5" role="region" aria-labelledby="elementor-tab-title-2525"><h4>Trigger the Call to the Endpoint From the Front-end Using Javascript</h4><div class="instructions"><ul><li class="color-blue">In PHP, declare the ajax_url object using <a href="https://developer.wordpress.org/reference/functions/wp_localize_script/" target="_blank" rel="noopener">wp_localize_script</a>. This is needed to call the PHP function from JS using the AJAX request.</li><li class="color-green">Add wordpress hooks to make a connection between the AJAX request action and the name of php function to call. &#8216;wp_ajax_nopriv&#8217; fires ONLY if the user is not logged-in while &#8216;wp_ajax&#8217; fires ONLY if the user is logged-in.</li><li class="color-orange">Create a PHP function which will be called from Javascript and in turn will call the Endpoint.</li><li class="color-purple">Finally in Javascript, create the function that will make an AJAX request to call the PHP function.</li></ul></div><div class="instructions-summary"><hr /><div class="code color-blue"><pre>wp_localize_script(
   'id_on_the_enqueued_script_that_will_use_it',
   'my_ajax_object',
   [ 'ajax_url' =&gt; admin_url( 'admin-ajax.php' ) ]
);
</pre></div><hr /><div class="code color-green"><pre>add_action('wp_ajax_nopriv_call_from_js_to_php', 'call_from_php');
add_action('wp_ajax_call_from_js_to_php', 'call_from_php');
</pre></div><hr /><div class="code color-orange"><pre>function call_from_php() {

   $first_name = $_GET['first_name'];
   $last_name = $_GET['last_name'];

   $response = wp_remote_get(
      "https://yourdomain.com/wp-json/get-user/v1/first/$first_name/last/$last_name", [
         'sslverify' =&gt; false,
      ]
   );

   if ( is_wp_error( $response ) ) {
      return new WP_Error( 'call_from_php unsuccessful', $response-&gt;get_error_message() );
   }

   wp_send_json(wp_remote_retrieve_body($response), 200);
}
</pre></div><hr /><div class="code color-purple"><pre>function call_from_js() {
   jQuery.ajax(my_ajax_object.ajax_url, {
      type: 'GET',
      data: {
            action: 'call_from_js_to_php',
            first_name: 'Gieon Felice',
            last_name: 'Aborot',
      },
   }).done(response =&gt; {
      const parsedResults = JSON.parse(response);
      // Do something with the result
   }).fail(error =&gt; {
      // Do something when an unsuccessful
   });
}
</pre></div></div></div>
				</div>
								</div>
						</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				<section class="elementor-section elementor-top-section elementor-element elementor-element-7fc21f9 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="7fc21f9" data-element_type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-b756090" data-id="b756090" data-element_type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-56a9374 elementor-widget elementor-widget-spacer" data-id="56a9374" data-element_type="widget" data-widget_type="spacer.default">
				<div class="elementor-widget-container">
							<div class="elementor-spacer">
			<div class="elementor-spacer-inner"></div>
		</div>
						</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				</div>
		<p>The post <a href="https://www.caskispace.com/how-to-query-wp-database-using-wp-rest/">Query Database Using WordPress REST</a> appeared first on <a href="https://www.caskispace.com">caskiSPACE</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Eve Echoes: How to Mine Safely in Low Sec</title>
		<link>https://www.caskispace.com/eve-echoes-safe-mining-guide/</link>
		
		<dc:creator><![CDATA[saborot]]></dc:creator>
		<pubDate>Mon, 24 Aug 2020 14:15:54 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://caskispace.com/?p=1600</guid>

					<description><![CDATA[<p>Eve Echoes Safe Mining Guide How to Mine Safely in Lower Security Systems Eve Echoes started out with almost everyone mining, friendly and everything, just enjoying the Eve Universe. A week later, some players decided to point their gun to miners. I&#8217;m not entirely sure why they&#8217;re doing it, I am most certain it&#8217;s not [&#8230;]</p>
<p>The post <a href="https://www.caskispace.com/eve-echoes-safe-mining-guide/">Eve Echoes: How to Mine Safely in Low Sec</a> appeared first on <a href="https://www.caskispace.com">caskiSPACE</a>.</p>
]]></description>
										<content:encoded><![CDATA[		<div data-elementor-type="wp-post" data-elementor-id="1600" class="elementor elementor-1600" data-elementor-post-type="post">
						<section class="elementor-section elementor-top-section elementor-element elementor-element-af6da66 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="af6da66" data-element_type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-f7e6a26" data-id="f7e6a26" data-element_type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-c14093c elementor-widget elementor-widget-spacer" data-id="c14093c" data-element_type="widget" data-widget_type="spacer.default">
				<div class="elementor-widget-container">
							<div class="elementor-spacer">
			<div class="elementor-spacer-inner"></div>
		</div>
						</div>
				</div>
				<div class="elementor-element elementor-element-f94f078 elementor-widget elementor-widget-heading" data-id="f94f078" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
					<h1 class="elementor-heading-title elementor-size-default">Eve Echoes Safe Mining Guide</h1>				</div>
				</div>
				<div class="elementor-element elementor-element-e08e5c1 elementor-widget elementor-widget-heading" data-id="e08e5c1" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
					<h2 class="elementor-heading-title elementor-size-default">How to Mine Safely in Lower Security Systems</h2>				</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				<section class="elementor-section elementor-top-section elementor-element elementor-element-c49959b elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="c49959b" data-element_type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-f1f8f02" data-id="f1f8f02" data-element_type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-4c5745f elementor-widget elementor-widget-text-editor" data-id="4c5745f" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									<p><strong><span style="font-size: 1rem;">Eve Echoes started out with almost everyone mining, friendly and everything, just enjoying the Eve Universe.</span></strong></p><p><span style="font-size: 1rem;">A week later, some players decided to point their gun to miners. I&#8217;m not entirely sure why they&#8217;re doing it, I am most certain it&#8217;s not for the ores because you can&#8217;t just blow someone up and pick-up the spoils using your destroyer or frigate. It could be just for fun, reputation or just to boast although I don&#8217;t see what&#8217;s there to boast blowing up someone who couldn&#8217;t fire back.</span></p><p><span style="font-size: 1rem;">After I joined a corp it all made sense; they do it for space dominance, so the corporation members or alliance can solo mine the system. The problem is, this made sense to them but not to those getting blown-up so I don&#8217;t know.</span></p>								</div>
				</div>
				<div class="elementor-element elementor-element-6f4acd7 elementor-widget elementor-widget-text-editor" data-id="6f4acd7" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									<p>Whatever this is, solo miners have to cope with it and continue mining without getting blown up to smithereens. The tips here does not guarantee 100% safety but it will give you a very good fighting chance to escape with your ship intact and ores in your cargo hold (for me at least, these are what matters most).</p>								</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				<section class="elementor-section elementor-top-section elementor-element elementor-element-f34c415 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="f34c415" data-element_type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-ac63bda" data-id="ac63bda" data-element_type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-70bea72 elementor-widget elementor-widget-heading" data-id="70bea72" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
					<p class="elementor-heading-title elementor-size-default">Make these your SOP when mining to significantly increase you chance of survival.</p>				</div>
				</div>
				<div class="elementor-element elementor-element-124318d elementor-widget elementor-widget-accordion" data-id="124318d" data-element_type="widget" data-widget_type="accordion.default">
				<div class="elementor-widget-container">
							<div class="elementor-accordion">
							<div class="elementor-accordion-item">
					<div id="elementor-tab-title-1911" class="elementor-tab-title" data-tab="1" role="button" aria-controls="elementor-tab-content-1911" aria-expanded="false">
												<a class="elementor-accordion-title" tabindex="0">Step 1. Set a Destination for Auto-Pilot</a>
					</div>
					<div id="elementor-tab-content-1911" class="elementor-tab-content elementor-clearfix" data-tab="1" role="region" aria-labelledby="elementor-tab-title-1911"><h4>Set a Destination for Auto-Pilot</h4>

<hr /><br>

<ol>
 	<li><strong>Go to your Inventory and select Personal Assets</strong>. This will list all stations which you have items stored.</li>
 	<li><strong>Select any from the list and tap on Jump, then set it as destination</strong>. This will enable your Auto-Pilot system and will appear on the upper-left of your screen. (<em><strong>Do not start auto-pilot</strong>, we just need to set a destination so we can start it with a tap of a button.</em>)</li>
</ol></div>
				</div>
							<div class="elementor-accordion-item">
					<div id="elementor-tab-title-1912" class="elementor-tab-title" data-tab="2" role="button" aria-controls="elementor-tab-content-1912" aria-expanded="false">
												<a class="elementor-accordion-title" tabindex="0">Step 2. Find the Area To Mine From</a>
					</div>
					<div id="elementor-tab-content-1912" class="elementor-tab-content elementor-clearfix" data-tab="2" role="region" aria-labelledby="elementor-tab-title-1912"><h4>Find the Area to Mine From</h4>

<hr /><br>

<ol>
 	<li><strong>Set your Overview to &#8216;Mining&#8217;</strong> and warp to a mining area.</li>
 	<li><strong>Scan the area for hostile ships</strong> (<em>if there are ships in the area aside from Industrial ones, warp to another &#8212; not worth the risk</em>).</li>
</ol></div>
				</div>
							<div class="elementor-accordion-item">
					<div id="elementor-tab-title-1913" class="elementor-tab-title" data-tab="3" role="button" aria-controls="elementor-tab-content-1913" aria-expanded="false">
												<a class="elementor-accordion-title" tabindex="0">Step 3. Start Mining</a>
					</div>
					<div id="elementor-tab-content-1913" class="elementor-tab-content elementor-clearfix" data-tab="3" role="region" aria-labelledby="elementor-tab-title-1913"><h4>Start Mining</h4>

<hr /><br>

Once you found a suitable area to mine from&#8230;
<ol>
 	<li><strong>Lock and approach the asteroid</strong> you want to mine and fire your mining turrets.</li>
</ol></div>
				</div>
							<div class="elementor-accordion-item">
					<div id="elementor-tab-title-1914" class="elementor-tab-title" data-tab="4" role="button" aria-controls="elementor-tab-content-1914" aria-expanded="false">
												<a class="elementor-accordion-title" tabindex="0">Step 4. Align to a Stargate / Station</a>
					</div>
					<div id="elementor-tab-content-1914" class="elementor-tab-content elementor-clearfix" data-tab="4" role="region" aria-labelledby="elementor-tab-title-1914"><h4>Align to a Stargate / Station</h4>

<hr /><br>

<ol>
 	<li><strong>Set your Overview to Stargate/Station</strong>, find the one that has a yellow icon (<em>this means that the Stargate is part of the path to your set destination</em>).</li>
 	<li><strong>Select the Stargate and approach it</strong> (<em>your ship will align to it and start moving but will not warp</em>).</li>
 	<li>Once it is facing the Stargate, <strong>stop your ship</strong>.</li>
</ol><br>
The reason why we are aligning our ship to the Stargate is so that when an aggressive player starts shooting in the area, we can hit auto-pilot and warp directly to it without realigning first.</div>
				</div>
							<div class="elementor-accordion-item">
					<div id="elementor-tab-title-1915" class="elementor-tab-title" data-tab="5" role="button" aria-controls="elementor-tab-content-1915" aria-expanded="false">
												<a class="elementor-accordion-title" tabindex="0">Step 5. Stand-by and Be on Guard</a>
					</div>
					<div id="elementor-tab-content-1915" class="elementor-tab-content elementor-clearfix" data-tab="5" role="region" aria-labelledby="elementor-tab-title-1915"><h4>Stand-by and Be on Guard</h4>

<hr /><br>

<ol>
 	<li><strong>Set you Overview to &#8216;Ship&#8217;</strong> (<em>this will show you all the ships in the area and the type of ship they are using</em>)</li>
 	<li><strong>Turn-up your sound a bit</strong> so you can hear the low-shield warning if you got hit.</li>
 	<li><strong>Be ready to press the auto-pilot</strong> button if you feel the need to warp-out of the area.</li>
</ol></div>
				</div>
								</div>
						</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				<section class="elementor-section elementor-top-section elementor-element elementor-element-799ce38 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="799ce38" data-element_type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-e6230c9" data-id="e6230c9" data-element_type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-2ec0a05 elementor-widget elementor-widget-spacer" data-id="2ec0a05" data-element_type="widget" data-widget_type="spacer.default">
				<div class="elementor-widget-container">
							<div class="elementor-spacer">
			<div class="elementor-spacer-inner"></div>
		</div>
						</div>
				</div>
				<div class="elementor-element elementor-element-7bedb56 elementor-widget elementor-widget-heading" data-id="7bedb56" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
					<h3 class="elementor-heading-title elementor-size-default">TIPS:</h3>				</div>
				</div>
				<div class="elementor-element elementor-element-fd39033 elementor-widget elementor-widget-text-editor" data-id="fd39033" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									<ol id="block-f5434159-9369-4d39-b33d-deea28151119" class="block-editor-block-list__block wp-block is-selected is-typing rich-text block-editor-rich-text__editable is-hovered wp-block" tabindex="0" role="textbox" contenteditable="true" aria-label="Write list…" aria-multiline="true" data-block="f5434159-9369-4d39-b33d-deea28151119" data-type="core/list" data-title="List"><li><strong>Use shield and armor hardeners</strong> instead of shield/armor repair modules because it has a delay before kicking in. We want to survive the first hit so we can warp out.</li><li><strong>Train skills</strong> that will increase you chance of survival. One set of skills that can increase the toughness of your ship is in the <strong>Maintenance Technology &gt; Defense Upgrade &gt; Industrial Ship Defense Upgrade</strong>. You can also increase your Shield/Armor hardener skills.</li><li><strong>Warp-out if another ship is locking on you.</strong> Enemy ships trying to gain a lock on you will have a flashing yellow icon on the Overview.</li><li>Warp-out if another non-industrial ship is closing in on you. <strong>Maintain at least 35km distance</strong> between other non-industrial ships; they can disable your ability to warp.</li></ol>								</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				<section class="elementor-section elementor-top-section elementor-element elementor-element-917ff8b elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="917ff8b" data-element_type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-c54e391" data-id="c54e391" data-element_type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-1104a96 elementor-widget elementor-widget-spacer" data-id="1104a96" data-element_type="widget" data-widget_type="spacer.default">
				<div class="elementor-widget-container">
							<div class="elementor-spacer">
			<div class="elementor-spacer-inner"></div>
		</div>
						</div>
				</div>
				<div class="elementor-element elementor-element-1e6513b elementor-widget elementor-widget-heading" data-id="1e6513b" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
					<h4 class="elementor-heading-title elementor-size-default">Other Resources:</h4>				</div>
				</div>
				<div class="elementor-element elementor-element-ccb8fd4 elementor-widget elementor-widget-text-editor" data-id="ccb8fd4" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									<ul><li><a href="/eve-echoes/">Ways to Earn ISKs on Eve Echoes Universe</a></li></ul>								</div>
				</div>
				<div class="elementor-element elementor-element-d84e7ff elementor-widget elementor-widget-spacer" data-id="d84e7ff" data-element_type="widget" data-widget_type="spacer.default">
				<div class="elementor-widget-container">
							<div class="elementor-spacer">
			<div class="elementor-spacer-inner"></div>
		</div>
						</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				</div>
		<p>The post <a href="https://www.caskispace.com/eve-echoes-safe-mining-guide/">Eve Echoes: How to Mine Safely in Low Sec</a> appeared first on <a href="https://www.caskispace.com">caskiSPACE</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
