How do I Normalize PowerShell WebRequest Results?

30 views Asked by At

This issue is related to data produced by Chrome DevTools.

1. Sign in to your twitter account.
2. Open dev tools, click on the filter icon, type "TweetDetail".
3. Visit the link containing the video or photo: https://twitter.com/StackOverflow/status/1684529654743330817.
4. Right click the link that appears then Copy >> Copy as PowerShell.
5. Add " | select Content | FL" (without quotes) right after -ContentType "application/json" on the last line.
6. Paste the whole code to PowerShell.

The result is containing strange code:

�:Y��(�����?[R:W�8^��9S♣C3▼@�QYd1►��8 jE��і:�B*�☻t�jRY��Ц8+F�z*��
          �B��2_�\�
          A���2
          g�s�ģ�# �}�^�
          }�'@�SL]l^1ꕟ��X↨��3▲k���V��,ܤC��2����L→$��↓�☻7����r���4�1aT{��D§K�Ćh�bS(‼u"!RU▲�      ∟��Ɂҁ/�B�☺♠B�J"�ȢW��)
�~C�J��eҀ<<�]�▼�@���hgvM|��ږQ��ٶ��������Z♺�t§V���=���
          �☺�Klkr�♦���p�azK"3I¶�)��,n�չ]�!�#���y�:��▬�W �'ы1���Yr��"�������ͣ��|∟ma�Y*b�^��MomHݶm(�kG��s�♦���,|<��9д♦�����5�[☺qO�Χ�☺,��)�ȍ���ڃ����O���U�tQ��{��f�
          ���^�p�ā��!g?.‼�E���j�}�.X�S�
ٙ�9BS�[�fy▬��a�-�D��D��=��W↑�t��↕�QP�Vt�&*�̣j�:�:�►���>4�◄�♦��<��;�4C|�������Z��▼m↔� 9��ߺҁ|�,[����▬�.
          ����h�^\�ʠQ�w�☻�ڊҺ���s��e��R^�m��b���&����3s�?.G�y��Y_♦����h�7>�m1�.�O��|�v���j��`7♥�w`���
          W�m}8���3Ze_� �E↔♦%}y↕b6)t�;��߳�m�‼h+�▼���?f�

..........

If the status does not contain videos or photos, like this one, then the results can be read normally:

Content : {"data":{"threaded_conversation_with_injections_v2":{"instructions":[{"type":"TimelineAddEntries","entries":[
          {"entryId":"tweet-1711788684243046525","sortIndex":"7511583352611729282","content":{"entryType":"TimelineTime
          lineItem","__typename":"TimelineTimelineItem","itemContent":{"itemType":"TimelineTweet","__typename":"Timelin
          eTweet","tweet_results":{"result":{"__typename":"Tweet","rest_id":"1711788684243046525","has_birdwatch_notes"
          :false,
..........

So, how do you make sure that the results of the request for the 1st URL are the same as the results of the request for the 2nd URL?.

NB: In the Linux terminal, Copy as cURL (bash), both links produce normal character output, aka readable.

0

There are 0 answers