Resources
The documentation includes information on how to download online text and photos, as well as specific instructions for downloading a Una photo.
Downloading Online Text
Get text from internet
{"blocks":"<xml xmlns=\"https://developers.google.com/blockly/xml\"><block type=\"Resources_getTextByURL\" disabled=\"true\" x=\"-22\" y=\"67\"><value name=\"url\"><shadow type=\"text\" disabled=\"true\"><field name=\"TEXT\"/></shadow></value></block></xml>"}
This block is used to get the text from online resources.
Parameters: String (URL)
Output: Text
Sample code:
{"blocks":"<xml xmlns=\"https://developers.google.com/blockly/xml\"><block type=\"pxt-on-start\" x=\"0\" y=\"0\"><statement name=\"HANDLER\"><block type=\"basic_consoleLogText\"><value name=\"text\"><block type=\"Resources_getTextByURL\"><value name=\"url\"><shadow type=\"text\"><field name=\"TEXT\">https://dictionary.cambridge.org/us/dictionary/english/text</field></shadow></value></block></value></block></statement></block></xml>"}
The output:
Downloading Online Photo
Get photo from internet
{"blocks":"<xml xmlns=\"https://developers.google.com/blockly/xml\"><block type=\"Resources_getPhotoByURL\" disabled=\"true\" x=\"-22\" y=\"112\"><value name=\"url\"><shadow type=\"text\" disabled=\"true\"><field name=\"TEXT\"/></shadow></value></block></xml>"}
This block is used to get the image from internet.
Parameters: String (URL)
Output: Image
Sample code:
{"blocks":"<xml xmlns=\"https://developers.google.com/blockly/xml\"><block type=\"pxt-on-start\" x=\"0\" y=\"0\"><statement name=\"HANDLER\"><block type=\"Camera_showPhoto\"><value name=\"photo\"><block type=\"Resources_getPhotoByURL\"><value name=\"url\"><shadow type=\"text\"><field name=\"TEXT\">https://upload.wikimedia.org/wikipedia/commons/thumb/f/f7/Bananas.svg/2560px-Bananas.svg.png</field></shadow></value></block></value></block></statement></block></xml>"}
The output:
Downloading Una Photo
Get photo from Una
{"blocks":"<xml xmlns=\"https://developers.google.com/blockly/xml\"><block type=\"Resources_getPhotoByResourceId\" disabled=\"true\" x=\"-22\" y=\"202\"><value name=\"id\"><shadow type=\"text\" disabled=\"true\"><field name=\"TEXT\"/></shadow></value></block></xml>"}
Table of Content