arcade-x 0.1.15__py3-none-any.whl → 0.1.16__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
arcade_x/tools/utils.py CHANGED
@@ -82,9 +82,10 @@ def expand_urls_in_tweets(
82
82
  new_tweet = tweet_data.copy()
83
83
  if "entities" in new_tweet and "urls" in new_tweet["entities"]:
84
84
  for url_entity in new_tweet["entities"]["urls"]:
85
- short_url = url_entity["url"]
86
- expanded_url = url_entity["expanded_url"]
87
- new_tweet["text"] = new_tweet["text"].replace(short_url, expanded_url)
85
+ if "url" in url_entity and "expanded_url" in url_entity:
86
+ short_url = url_entity["url"]
87
+ expanded_url = url_entity["expanded_url"]
88
+ new_tweet["text"] = new_tweet["text"].replace(short_url, expanded_url)
88
89
 
89
90
  if delete_entities:
90
91
  new_tweet.pop("entities", None)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: arcade_x
3
- Version: 0.1.15
3
+ Version: 0.1.16
4
4
  Summary: Arcade.dev LLM tools for X (Twitter)
5
5
  Author-email: Arcade <dev@arcade.dev>
6
6
  License-File: LICENSE
@@ -3,8 +3,8 @@ arcade_x/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  arcade_x/tools/constants.py,sha256=d-OJK5Qx05JRUcpK5G1DcYB91wT37hFSzGmIYfwlEtA,42
4
4
  arcade_x/tools/tweets.py,sha256=S1Psv-gFePz-8ibnp7rY-GCdogkAm-hJQZpHf7hUusk,7498
5
5
  arcade_x/tools/users.py,sha256=gopYKTBOwbZAeVdL_T3vwkepbpv1bdPbqcU_2oPC3SY,2132
6
- arcade_x/tools/utils.py,sha256=Xx4S5bq0udUwSiodf5cs19ftgWHROO-scpY3RY-Fam8,5376
7
- arcade_x-0.1.15.dist-info/METADATA,sha256=4Y_NCBB8UOHDcKEdJMGGWVV1FfsEMkluR3ebobt0OwE,835
8
- arcade_x-0.1.15.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
9
- arcade_x-0.1.15.dist-info/licenses/LICENSE,sha256=f4Q0XUZJ2MqZBO1XsqqHhuZfSs2ar1cZEJ45150zERo,1067
10
- arcade_x-0.1.15.dist-info/RECORD,,
6
+ arcade_x/tools/utils.py,sha256=wxPdp3JDG-gEDM7XUNiZSgL61isVE3SRqaLiwYP-K40,5461
7
+ arcade_x-0.1.16.dist-info/METADATA,sha256=7ox9l5R61ZAaxf46r2Bwib5vxmr1OrWB19LSldl_k2Q,835
8
+ arcade_x-0.1.16.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
9
+ arcade_x-0.1.16.dist-info/licenses/LICENSE,sha256=f4Q0XUZJ2MqZBO1XsqqHhuZfSs2ar1cZEJ45150zERo,1067
10
+ arcade_x-0.1.16.dist-info/RECORD,,