GetIP Function - Tikolu/SETTI GitHub Wiki

The GetIP function can be used to see what IP Address last edited a page.

Usage

setti.GetIP(page)

page - the page you want to get the IP from

The GetIP command will return the IP Address of the last editor of a page. If nobody ever edited the page, it will return no one.

Examples

print(setti.GetIP("rospa"))

Prints the IP Address of the last person who edited http://htwins.net/edit/rospa to the console.


memory = setti.GetIP("scissors")
while memory == setti.GetIP("scissors"):
     print("No Change...")
print("Editted by " + setti.GetIP("scissors"))

Checks if a page has been edited by someone else.


userIP = input("What is your IP address?")
while True:
     pageToGet = input("What page would you like to access?")
     pageIP = setti.GetIP(pageToGet)
     if pageIP == userIP:
          print(pageToGet + " was last edited by you.")
     elif pageIP == "no one":
          print(pageToGet + " was never edited by anyone.")
     else:
          print(pageToGet + " was last edited by " + pageIP)

Asks the user for their IP Address and a page. Then, it says was the site edited by them, or someone else.