Browse Source

change from ur1.ca to link.fsfe.org

mxmehl 3 years ago
parent
commit
6e34f27c9f
4 changed files with 8 additions and 7 deletions
  1. 1
    0
      .gitignore
  2. 1
    0
      .userpass.txt.sample
  3. 4
    4
      config.cfg.sample
  4. 2
    3
      twitter-pic.sh

+ 1
- 0
.gitignore View File

@@ -1,2 +1,3 @@
1 1
 config.cfg
2 2
 .twitter.db
3
+.userpass.txt

+ 1
- 0
.userpass.txt.sample View File

@@ -0,0 +1 @@
1
+-u username:password

+ 4
- 4
config.cfg.sample View File

@@ -1,6 +1,6 @@
1 1
 DIR="pic"
2
-DOMAIN="https://example.com/twitter"
2
+DOMAIN="https://serv.mehl.mx/twitter"
3 3
 DB=".twitter.db"
4
-SLSERV="http://ur1.ca"
5
-SLGREP1="Your ur1 is"
6
-SLGREP2="http://ur1.ca/[a-zA-Z0-9]*"
4
+SLSERV="http://link.fsfe.org/index.rb"
5
+SLGREP1='Your link is: <a href=.*?>.*?</a>'
6
+SLGREP2="http://l.fsfe.org/[a-zA-Z0-9]*"

+ 2
- 3
twitter-pic.sh View File

@@ -49,7 +49,7 @@ if [ "$DBCHECK" != "" ]; then   # file has already been downloaded
49 49
 else                            # file hasn't been downloaded yet
50 50
   ok="n"
51 51
   while [ "$ok" != "y" ]; do
52
-    RAND=$(openssl rand -hex 4)
52
+    RAND=$(openssl rand -hex 3)
53 53
     if [ ! -e "$DIR/$RAND.$EXT" ]; then
54 54
       ok="y"
55 55
     fi
@@ -57,9 +57,8 @@ else                            # file hasn't been downloaded yet
57 57
 
58 58
   LCIMG="$DIR/$RAND.$EXT"
59 59
   LCLINK="$DOMAIN/$LCIMG"
60
-  
61
-  SLLINK=$(curl -s "$SLSERV" -d"longurl=$LCLINK" -A "Mozilla" | grep -i "$SLGREP1" | sed -e 's/<[^>]*>//g' | grep -Eo "$SLGREP2")
62 60
 
61
+  SLLINK=$(curl -K .userpass.txt -s "$SLSERV" -d "link=$LCLINK" -A "Mozilla" | grep -P -io "$SLGREP1" | sed -e 's/<[^>]*>//g' | grep -Eo "$SLGREP2")
63 62
 
64 63
   echo "$TWFILE;$SLLINK;$LCLINK" >> "$DB"
65 64
 

Loading…
Cancel
Save