What Data Format is this? - formatting

Does anyone know what format this data is?
PFNsaWRlT3V0bGluZT4KICA8U0lQIHVpZD0iNTM3M0E2OTEtNkQ5Ri01N0E3LUI5M0ItRjZCOThDQjQwMEM5IiBpZD0iRjg1MDBDNzctOUQ0Ni1BODI5LUE0MDEtRjZCOThDQTAxNTdFIiB1dklEPSJhNjAzNjU4Mi0yMzdiLTQzNDktOWNkOS03MzViZjVmZDAxNTYiLz4KICA8U0lQIHVpZD0iRkU4Qzg5RTAtREMxQy00MUVBLTNBQzctMDQzM0JENEQyMUVCIiBpZD0iODQyNjRFNkYtOEZDRS0yMUQ0LUQwMTAtRjRDNTAzQkQ3NjUzIiB1dklEPSJjZjU2ZGYxOC04ZTVkLTRlNDUtYmQyMS0wNTBjNmM5NGYyZWEiLz4KICA8U0lQIHVpZD0iQzY1NDBFNkEtNDM0My1ENEQ4LUEwQjYtMDQzM0NFQ0MyMDg5IiBpZD0iMjFFRjVFQTItRjBEMy1FODk4LTE4MTctRjRDOEQzRUI0REU3IiB1dklEPSI0NDY0ZjYwNy04M2UwLTQ5OGMtOGFiZS1iNDViNTQwOWYwMDgiLz4KPC9TbGlkZU91dGxpbmU+
thanks

It's base64 encoded XML:
<SlideOutline>
<SIP uid="5373A691-6D9F-57A7-B93B-F6B98CB400C9" id="F8500C77-9D46-A829-A401-F6B98CA0157E" uvID="a6036582-237b-4349-9cd9-735bf5fd0156"/>
<SIP uid="FE8C89E0-DC1C-41EA-3AC7-0433BD4D21EB" id="84264E6F-8FCE-21D4-D010-F4C503BD7653" uvID="cf56df18-8e5d-4e45-bd21-050c6c94f2ea"/>
<SIP uid="C6540E6A-4343-D4D8-A0B6-0433CECC2089" id="21EF5EA2-F0D3-E898-1817-F4C8D3EB4DE7" uvID="4464f607-83e0-498c-8abe-b45b5409f008"/>
</SlideOutline>

Most probably pure Base-64. It doesn't have line breaks in it, unlike Base-64 encoding used in emails. You can find the details in RFC 3548.

Related

Big Query - extract json field which contains emoji?

In my BQ database table I have a column called payload which contains raw facebook webhooks JSON payloads as string. One of them contains a text with an emoji like Sample 🏦. In big query it look like
{"object":"page","entry":[{"id":"xxxx","time":1602757469275,"messaging":[{"sender":{"id":"xxxx"},"recipient":{"id":"xxxx"},"timestamp":1602757469062,"message":{"mid":"m_xxxx","text":"Sample \ud83c\udfe6","quick_reply":{"payload":"{\"key\": \"value\"}"},"tags":{"source":"source"}}}]}]}
I would like to create a view with a column text with extracted text field value from the raw json. I created an sql like
SELECT
JSON_EXTRACT_SCALAR(payload, '$.entry[0].messaging[0].message.text') as text,
FROM `my_table.facebook.webhook_received`
Sadly the result I get looks like that Sample ��
Does anyone know how to make big query decode the emoji properly or at least just not change it to those � signs ?
Those characters you have embedded are not for a bank icon which is your issue I believe.
Run the following in BQ and it returns the desired emoji:
select " Sample \U0001f3e6"
Ref:https://emojipedia.org/bank/
The two you have provided seem to default to the '?', invalid character
http://unicode.scarfboy.com/?s=U%2Bdfe6
edit: what ever is handling the message maybe throwing the encodings you're seeing in your message which may be the actual problem.
If you are using BigQuery Python client and its load_table_from_json method, there is a Unicode bug (especially its byte is over 0xFFFF, like 🏦) in the previous version, and I have submitted this bug fix which is already included in the latest release include it, https://github.com/googleapis/python-bigquery/releases/tag/v2.24.0. By the way, you should use \U0001F3E6, not \ud83c\udfe6 (UTF-16 hex type) to present 🏦 in your Python code with BigQuery.
Unicode Character 'BANK': https://www.fileformat.info/info/unicode/char/1f3e6/index.htm,
https://charbase.com/1f3e6-unicode-bank

What should i use to parse and unparse data like : "a:66:{s:24:"images";a:0:{} s:26:"thumbnail_image";s:0:"";:"... ?

I'm working with ThemeFuse I found this data format. But it not looks like anything I saw before.
a:66:{s:24:"autotrader_slider_images";a:0:{}s:26:"autotrader_thumbnail_image";s:0:"";s:19:"seek_property_price";s:0:"";s:23:"seek_property_vat_price";s:0:"";s:21:"seek_property_mileage";s:0:"";s:25:"seek_property_engine_size";s:0:"";s:30:"seek_property_engine_power_bhp";s:0:"";s:29:"seek_property_engine_power_kw";s:0:"";s:23:"seek_property_reduction";s:1:"0";s:25:"seek_property_consumption";s:1:"0";s:20:"seek_property_origin";s:0:"";s:22:"seek_property_emission";s:13:"super emitivo";s:23:"autotrader_vehicle_type";s:3:"SUV";s:20:"autotrader_fuel_type";s:6:"Diesel";s:23:"autotrader_gearbox_type";s:9:"Automatic";s:17:"autotrader_status";s:6:"Intact";s:16:"autotrader_color";s:5:"White";s:18:"seek_property_year";s:0:"";s:26:"autotrader_enable_comments";s:5:"false";s:29:"autotrader_enable_breadcrumbs";s:4:"true";s:25:"autotrader_header_element";s:4:"none";s:23:"autotrader_header_image";s:0:"";s:23:"autotrader_header_title";s:0:"";s:24:"autotrader_select_slider";s:2:"-1";s:19:"autotrader_page_map";s:0:"";s:19:"autotrader_map_text";s:11:"We are here";s:19:"autotrader_map_zoom";s:2:"13";s:25:"autotrader_search_element";s:4:"none";s:22:"autotrader_content_top";s:0:"";s:26:"autotrader_content_bottom1";s:0:"";s:25:"autotrader_footer_element";s:4:"none";s:31:"autotrader_select_slider_footer";s:2:"-1";s:25:"autotrader_content_bottom";s:0:"";s:26:"autotrader_content_bottom2";s:0:"";s:23:"autotrader_top_ad_space";s:5:"false";s:23:"autotrader_top_ad_image";s:0:"";s:21:"autotrader_top_ad_url";s:0:"";s:25:"autotrader_top_ad_adsense";s:0:"";s:30:"autotrader_bfcontent_ads_space";s:5:"false";s:25:"autotrader_bfcontent_type";s:5:"image";s:27:"autotrader_bfcontent_number";s:3:"one";s:31:"autotrader_bfcontent_ads_image1";s:0:"";s:29:"autotrader_bfcontent_ads_url1";s:0:"";s:33:"autotrader_bfcontent_ads_adsense1";s:0:"";s:31:"autotrader_bfcontent_ads_image2";s:0:"";s:29:"autotrader_bfcontent_ads_url2";s:0:"";s:33:"autotrader_bfcontent_ads_adsense2";s:0:"";s:31:"autotrader_bfcontent_ads_image3";s:0:"";s:29:"autotrader_bfcontent_ads_url3";s:0:"";s:33:"autotrader_bfcontent_ads_adsense3";s:0:"";s:31:"autotrader_bfcontent_ads_image4";s:0:"";s:29:"autotrader_bfcontent_ads_url4";s:0:"";s:33:"autotrader_bfcontent_ads_adsense4";s:0:"";s:31:"autotrader_bfcontent_ads_image5";s:0:"";s:29:"autotrader_bfcontent_ads_url5";s:0:"";s:33:"autotrader_bfcontent_ads_adsense5";s:0:"";s:31:"autotrader_bfcontent_ads_image6";s:0:"";s:29:"autotrader_bfcontent_ads_url6";s:0:"";s:33:"autotrader_bfcontent_ads_adsense6";s:0:"";s:31:"autotrader_bfcontent_ads_image7";s:0:"";s:29:"autotrader_bfcontent_ads_url7";s:0:"";s:33:"autotrader_bfcontent_ads_adsense7";s:0:"";s:21:"autotrader_hook_space";s:5:"false";s:21:"autotrader_hook_image";s:0:"";s:19:"autotrader_hook_url";s:0:"";s:23:"autotrader_hook_adsense";s:0:"";}
What should I use to parse and unparse this format?
This is serialized PHP array.
All you need to do is to unserialize it.
http://php.net/manual/en/function.unserialize.php

Flickr api_sig (api signature)

pls help me with calculating api_sig. I have working URL request from here (www.flickr.com/services/api/explore/flickr.photosets.getP...).
I'm trying recalculate api_sig by myself. I'm generating md5 hash from this string:
"api_key071da8bd47cc06715f12e139
auth_token7215764931-65136290ea10d4b6
formatrest
methodflickr.photosets.getPhotosphoto
set_id7215924989144"
I don't know what should i use like [secret code]. Is it secret API key or is it "secret" from photoset? Or is it something else?
My string for md5 hash is:
"[secret]
api_key071da63edd47cc06715f12e139
auth_token757925931-65136290ea10d4b6
formatrestmethodflickr.photosets.getPhotos
photoset_id721746989144"
What am I doing wrong? I am getting different hash.
Thank you in advance for your advice and please excuse my English.
You should remove the whitespaces from the string i.e. you should just generate a md5-string from this: "api_key071da8bd47cc06715f12e139auth_token7215764931-65136290ea10d4b6formatrestmethodflickr.photosets.getPhotosphotoset_id7215924989144". And then use that as the api_sig parameter.
Here are the steps: https://www.flickr.com/services/api/auth.spec.html#signing

Chameleon: Why is a repeating comment truncated?

I'm having trouble with the transformation of an HL7 message. Its got an NTE segment with repeating fields of type string.
ex:
MSH|^~\&|HOST||TD-SYN||201207031000||ORU^R01|0017|P|2.3
PID|1||0001|
NTE|||Comment 1~Comment 2~Comment3
What happens after a graphical transformation is, NTE just takes Comment 1 and the rest of the repeating comments are ignored.
MSH|^~\&|HOST||TD-SYN||201207031000||ORU^R01|0017|P|2.3
PID|1||0001|
NTE|||Comment 1|
I tried setting the "Repeats" field of NTE segment's grammar to 10 but doesn't make a difference. Also, no script is manipulating that field of NTE, so I have no idea why it truncates it that way. Can someone tell me what's going on?
Glad you found it. Just as a general help, use sometimes the HAPI TestPanel to convert into XML, then you see very well how to loop over your HL7 elements. You then also know if you're using a correct HL7 structure.
In your example on the 3rd element in NTE <NTE.3>:
<?xml version="1.0" encoding="UTF-8"?>
<ORU_R01 xmlns="urn:hl7-org:v2xml">
<MSH>
<MSH.1>|</MSH.1>
<MSH.2>^~\&</MSH.2>
<MSH.3>
<HD.1>HOST</HD.1>
</MSH.3>
<MSH.5>
<HD.1>TD-SYN</HD.1>
</MSH.5>
<MSH.7>
<TS.1>201207031000</TS.1>
</MSH.7>
<MSH.9>
<CM_MSG.1>ORU</CM_MSG.1>
<CM_MSG.2>R01</CM_MSG.2>
</MSH.9>
<MSH.10>0017</MSH.10>
<MSH.11>
<PT.1>P</PT.1>
</MSH.11>
<MSH.12>2.3</MSH.12>
</MSH>
<ORU_R01.RESPONSE>
<ORU_R01.PATIENT>
<PID>
<PID.1>1</PID.1>
<PID.3>
<CX.1>0001</CX.1>
</PID.3>
</PID>
<NTE>
<NTE.3>Comment 1</NTE.3>
<NTE.3>Comment 2</NTE.3>
<NTE.3>Comment3</NTE.3>
</NTE>
</ORU_R01.PATIENT>
</ORU_R01.RESPONSE>
</ORU_R01>
I just found the answer from its documentation. It isn't actually truncated.
The default value of "value" is the first element in the repeatable field. Thus,
all I had to do is to access the repeating fields via field.repeat_field(index).value. :)

Using drupal profile date in vb.net

I am using drupal databas ein one of my application. Drupal profile saves date in following format:
a:3:{s:5:"month";s:1:"2";s:3:"day";s:2:"18";s:4:"year";s:4:"1995";}
I can read this with data reader but how to convert in a proper display like DD/MM/YYYY or YYYY/MM/DD
Well, you can kind of see the values for month, day and year in that zany string. Presumably there is something in VB that can help you parse and glue together the string as you need it?
You might look into how PHP's unserialize() works, that will reformat the string to a more usable array.
Most of all, dont use profile, use content_profile and cck. Problem solved. Unserializing PHP serialization can get a bit hairy.